diff --git a/OpenRA.Mods.Common/Traits/World/Locomotor.cs b/OpenRA.Mods.Common/Traits/World/Locomotor.cs index 55155402e0..23f38a970a 100644 --- a/OpenRA.Mods.Common/Traits/World/Locomotor.cs +++ b/OpenRA.Mods.Common/Traits/World/Locomotor.cs @@ -348,7 +348,7 @@ namespace OpenRA.Mods.Common.Traits if (check <= BlockedByActor.Immovable && cellFlag.HasCellFlag(CellFlag.HasMovableActor) && actor.Owner.Stances[otherActor.Owner] == Stance.Ally) { - var mobile = otherActor.TraitOrDefault(); + var mobile = otherActor.OccupiesSpace as Mobile; if (mobile != null && !mobile.IsTraitDisabled && !mobile.IsTraitPaused && !mobile.IsImmovable) return false; } @@ -369,7 +369,7 @@ namespace OpenRA.Mods.Common.Traits if (cellFlag.HasCellFlag(CellFlag.HasTransitOnlyActor)) { // Transit only tiles should not block movement - var building = otherActor.TraitOrDefault(); + var building = otherActor.OccupiesSpace as Building; if (building != null && building.TransitOnlyCells().Contains(cell)) return false; }