Skip to content

Commit

Permalink
Add support for AITriggers to ID regeneration
Browse files Browse the repository at this point in the history
  • Loading branch information
Rampastring committed Oct 13, 2024
1 parent e91b37d commit c1d06f1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/TSMapEditor/Models/Map.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1454,18 +1454,20 @@ public void RegenerateInternalIds()
var teamtypes = TeamTypes.FindAll(filter);
var tags = Tags.FindAll(filter);
var triggers = Triggers.FindAll(filter);
var aiTriggers = AITriggerTypes.FindAll(filter);

scriptElements.AddRange(tfs);
scriptElements.AddRange(scripts);
scriptElements.AddRange(teamtypes);
scriptElements.AddRange(tags);
scriptElements.AddRange(triggers);
scriptElements.AddRange(aiTriggers);
scriptElements = scriptElements.OrderBy(se => se.GetInternalID()).ToList();

tfs.ForEach(tf => LoadedINI.RemoveSection(tf.ININame));
scripts.ForEach(s => LoadedINI.RemoveSection(s.ININame));
teamtypes.ForEach(tt => LoadedINI.RemoveSection(tt.ININame));
// Our map writing system takes care of the tags and triggers, no need to manually remove their INI entries
// Our map writing system takes care of tags, triggers, and AITriggers, no need to manually remove their INI entries
// (they don't have sections)

// Build dictionary of old ID to scripting element for "ID swizzling" to correct triggers' references to other scripting elements
Expand Down

0 comments on commit c1d06f1

Please sign in to comment.