|
|
|
@ -1,5 +1,5 @@ |
|
|
|
|
{ |
|
|
|
|
ESMify Plugins 1.0 |
|
|
|
|
Skyrim ESMifier 1.0 |
|
|
|
|
by Eddoursul https://eddoursul.win |
|
|
|
|
|
|
|
|
|
For proper overriding of temporary records, "Always save ONAM" must be enabled in xEdit. |
|
|
|
@ -12,7 +12,7 @@ |
|
|
|
|
assign valid locations to actors via the Persistent Location field. |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
unit ESMify_Plugins; |
|
|
|
|
unit Skyrim_ESMifier; |
|
|
|
|
|
|
|
|
|
var |
|
|
|
|
refsChecked, recordsCounted, flaggedCount, persLocSkipped: integer; |
|
|
|
@ -43,16 +43,23 @@ 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 |
|
|
|
|
|
|
|
|
|
// When referencing record is not referenced and it's in the same cell, the ref does not need persistence. |
|
|
|
|
if (ReferencedByCount(referencingRecord) = 0) then begin |
|
|
|
|
if (sig = 'REFR') then begin |
|
|
|
|
if InSameCell(rec, referencingRecord) then continue; |
|
|
|
|
end; |
|
|
|
|
end; |
|
|
|
|
// Not always true, needs investigating. |
|
|
|
|
//if (ReferencedByCount(referencingRecord) = 0) then begin |
|
|
|
|
// if (sig = 'REFR') then begin |
|
|
|
|
// if InSameCell(rec, referencingRecord) then continue; |
|
|
|
|
// end; |
|
|
|
|
//end; |
|
|
|
|
|
|
|
|
|
// Refs referencing themselves do not require the flag |
|
|
|
|
if not SameRecord(rec, referencingRecord) then begin |
|
|
|
@ -244,6 +251,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 //////////////////////////////////// |
|
|
|
|
|