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 172c4c6 commit fbdd96f
Show file tree
Hide file tree
Showing 2 changed files with 3 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
1 change: 0 additions & 1 deletion OpenRA.Mods.Common/Traits/World/Locomotor.cs
Expand Up @@ -380,7 +380,6 @@ public void WorldLoaded(World w, WorldRenderer wr)
blockingCache = new CellLayer<CellCache>(map);
cellsCost = new CellLayer<short>(map);


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

foreach (var cell in map.AllCells)
Expand Down

0 comments on commit fbdd96f

Please sign in to comment.