Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unit BoundaryIssues;
- const OutputFileName = 'Boundary Issues.esp';
- function Initialize: Integer;
- var
- OutputFile, CurrentFile, Group, E: IInterface;
- I, J, K: Integer;
- MasterList: TStringList;
- begin
- for I := 0 to FileCount - 1 do
- begin
- CurrentFile := FileByIndex(I);
- if GetFileName(CurrentFile) = OutputFileName then
- begin
- OutputFile := CurrentFile;
- Remove(GroupBySignature(OutputFile, 'ECZN'));
- CleanMasters(OutputFile);
- Break
- end
- end;
- if not Assigned(OutputFile) then
- OutputFile := AddNewFileName(OutputFileName);
- MasterList := TStringList.Create;
- for I := 0 to GetLoadOrder(OutputFile) - 1 do
- begin
- CurrentFile := FileByIndex(I);
- if not HasGroup(CurrentFile, 'ECZN') then
- Continue;
- Group := GroupBySignature(CurrentFile, 'ECZN');
- AddMessage(GetFileName(CurrentFile));
- for J := 0 to ElementCount(Group) - 1 do
- begin
- E := ElementByIndex(Group, J);
- if not IsMaster(E) then
- Continue;
- AddMessage(' ' + Name(E));
- E := WinningOverride(E);
- MasterList.Clear;
- ReportRequiredMasters(E, MasterList, False, False);
- for K := 0 to MasterList.Count - 1 do
- AddMasterIfMissing(OutputFile, MasterList[K]);
- E := wbCopyElementToFile(WinningOverride(E), OutputFile, False, True);
- SetElementNativeValues(E, 'DATA\Flags\Disable Combat Boundary', True)
- end
- end
- end;
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement