From af725304482a6eb7acbe82fcd899666f7493c07e Mon Sep 17 00:00:00 2001 From: Eddoursul Date: Tue, 24 Oct 2023 18:29:57 +0200 Subject: [PATCH] Syntax fixes --- ESMify_Plugins.pas | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) 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;