Reset Locomotor cache on world loaded

This commit is contained in:
teinarss
2019-08-05 19:58:05 +02:00
committed by reaperrr
parent ab9834fdcd
commit 4193247169
2 changed files with 3 additions and 1 deletions

View File

@@ -71,6 +71,9 @@ namespace OpenRA.Mods.Common.Traits
else if (locomotorInfos.Count(li => li.Name == Locomotor) > 1) else if (locomotorInfos.Count(li => li.Name == Locomotor) > 1)
throw new YamlException("There is more than one locomotor named '{0}'.".F(Locomotor)); throw new YamlException("There is more than one locomotor named '{0}'.".F(Locomotor));
// We need to reset the reference to the locomotor between each worlds, otherwise we are reference the previous state.
locomotor = null;
base.RulesetLoaded(rules, ai); base.RulesetLoaded(rules, ai);
} }

View File

@@ -380,7 +380,6 @@ namespace OpenRA.Mods.Common.Traits
blockingCache = new CellLayer<CellCache>(map); blockingCache = new CellLayer<CellCache>(map);
cellsCost = new CellLayer<short>(map); cellsCost = new CellLayer<short>(map);
terrainInfos = Info.TilesetTerrainInfo[map.Rules.TileSet]; terrainInfos = Info.TilesetTerrainInfo[map.Rules.TileSet];
foreach (var cell in map.AllCells) foreach (var cell in map.AllCells)