diff --git a/ESMify_Plugins.pas b/ESMify_Plugins.pas index a165681..290586e 100644 --- a/ESMify_Plugins.pas +++ b/ESMify_Plugins.pas @@ -20,6 +20,9 @@ var hardcodedStatForms: TStringList; dragonCZMarker, dragonLZMarker: IwbMainRecord; + +///// FUNCTIONS //////////////////////////////////// + function IsReferencedByNonLocation(rec: IwbMainRecord): boolean; var masterRecord, referencingRecord: IwbMainRecord; @@ -180,7 +183,7 @@ begin end; end; -function IsSameCellPackage(inputValues: IwbElement): boolean; +function IsSameCellPackage(e: IInterface; inputValues: IwbElement): boolean; var packageLoc: string; inputVal: IwbElement; @@ -196,7 +199,6 @@ begin if packageLoc <> '' then begin if (packageLoc = 'Near editor location') or (packageLoc = 'Near self') then begin - //AddMessage(' Skipping editor location actor: ' + GetElementEditValues(e, 'NAME') + ' - (' + Name(e) + ')'); continue; end else if (packageLoc = 'In cell') then begin @@ -224,7 +226,8 @@ begin else if (packageLoc = 'Specific Reference') then begin linkedRef := LinksTo(ElementByPath(inputVal, 'PTDA\Target Data\Reference')); if InSameCell(e, linkedRef) then continue; - end; + end + else continue; end; result := False; @@ -232,6 +235,9 @@ begin end; end; + +///// PROCESSING //////////////////////////////////// + function Initialize: integer; var dobj: IwbMainRecord; begin @@ -329,7 +335,7 @@ begin end else if baseSig = 'ACTI' then begin // Flag water activators - if ElementExists(baseRefRecord, 'WNAM')) then begin + if ElementExists(baseRefRecord, 'WNAM') then begin MarkPersistent(e); exit; end; @@ -397,14 +403,14 @@ begin continue; end; - if (IsSameCellPackage(ElementByPath(package, 'Package Data\Data Input Values'))) then continue; + if (IsSameCellPackage(e, ElementByPath(package, 'Package Data\Data Input Values'))) then continue; skip := false; break; end; if skip then begin - AddMessage(' Skipping actor, staying in the same cell: ' + GetElementEditValues(e, 'NAME') + ' - (' + Name(e) + ')'); + //AddMessage(' Skipping actor, staying in the same cell: ' + GetElementEditValues(e, 'NAME') + ' - (' + Name(e) + ')'); exit; end;