Skip to content

Commit

Permalink
Reset Locomotor cache on world loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
teinarss committed Aug 10, 2019
1 parent 1289fb3 commit 07b1ec5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions OpenRA.Mods.Common/Traits/Mobile.cs
Expand Up @@ -71,6 +71,9 @@ public override void RulesetLoaded(Ruleset rules, ActorInfo ai)
else if (locomotorInfos.Count(li => li.Name == Locomotor) > 1)
throw new YamlException("There is more than one locomotor named '{0}'.".F(Locomotor));

// We need to reset the reset the reference to the locomotor between each worlds, otherwise we are reference the previous state.
locomotor = null;

base.RulesetLoaded(rules, ai);
}

Expand Down
2 changes: 1 addition & 1 deletion OpenRA.Mods.Common/Traits/World/Locomotor.cs
Expand Up @@ -379,7 +379,7 @@ public void WorldLoaded(World w, WorldRenderer wr)
actorMap.CellUpdated += CellUpdated;
blockingCache = new CellLayer<CellCache>(map);
cellsCost = new CellLayer<short>(map);

dirtyCells.Clear();

terrainInfos = Info.TilesetTerrainInfo[map.Rules.TileSet];

Expand Down

0 comments on commit 07b1ec5

Please sign in to comment.