diff --git a/OpenRA.Mods.Common/Traits/Mobile.cs b/OpenRA.Mods.Common/Traits/Mobile.cs index e72736b52e..c38441fb2f 100644 --- a/OpenRA.Mods.Common/Traits/Mobile.cs +++ b/OpenRA.Mods.Common/Traits/Mobile.cs @@ -71,6 +71,9 @@ namespace OpenRA.Mods.Common.Traits 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 reference to the locomotor between each worlds, otherwise we are reference the previous state. + locomotor = null; + base.RulesetLoaded(rules, ai); } diff --git a/OpenRA.Mods.Common/Traits/World/Locomotor.cs b/OpenRA.Mods.Common/Traits/World/Locomotor.cs index e0b3b78533..3d9a9ccd88 100644 --- a/OpenRA.Mods.Common/Traits/World/Locomotor.cs +++ b/OpenRA.Mods.Common/Traits/World/Locomotor.cs @@ -380,7 +380,6 @@ namespace OpenRA.Mods.Common.Traits blockingCache = new CellLayer(map); cellsCost = new CellLayer(map); - terrainInfos = Info.TilesetTerrainInfo[map.Rules.TileSet]; foreach (var cell in map.AllCells)