From add6832e558f067cdb38b216691bebbe8167fe73 Mon Sep 17 00:00:00 2001 From: Eddoursul Date: Tue, 24 Oct 2023 19:52:06 +0200 Subject: [PATCH] Do not consider formlists, created by Plugins Merge, true references --- ESMify_Plugins.pas | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/ESMify_Plugins.pas b/ESMify_Plugins.pas index 2184b7b..563c734 100644 --- a/ESMify_Plugins.pas +++ b/ESMify_Plugins.pas @@ -43,6 +43,12 @@ begin if (sig = 'LCTN') or (sig = 'WRLD') or (sig = 'TES4') then continue; + // Do not consider formlists, created by Plugins Merge, true references + if sig = 'FLST' then + if ReferencedByCount(referencingRecord) = 0 then + if StrEndsWith(EditorID(referencingRecord), 'Forms') then + continue; + // Only check plugins higher in the load order. // This will include non-masters as well, and will not take references from plugins lower in the load order into consideration. if GetLoadOrder(GetFile(referencingRecord)) <= GetLoadOrder(GetFile(rec)) then begin @@ -244,6 +250,20 @@ begin end; end; +// Copied from mteFunctions by Mator +function StrEndsWith(s1, s2: string): boolean; +var + i, n1, n2: integer; +begin + Result := false; + + n1 := Length(s1); + n2 := Length(s2); + if n1 < n2 then exit; + + Result := (Copy(s1, n1 - n2 + 1, n2) = s2); +end; + ///// PROCESSING ////////////////////////////////////