From 85a5b6cc1747899ef067b1027148fd817924af69 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sun, 26 Jan 2020 13:23:28 +0000 Subject: [PATCH] Fix subcell crusher logic. --- OpenRA.Mods.Common/Traits/Mobile.cs | 2 +- OpenRA.Mods.Common/Traits/World/Locomotor.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenRA.Mods.Common/Traits/Mobile.cs b/OpenRA.Mods.Common/Traits/Mobile.cs index 0eff7a090d..1e83280496 100644 --- a/OpenRA.Mods.Common/Traits/Mobile.cs +++ b/OpenRA.Mods.Common/Traits/Mobile.cs @@ -560,7 +560,7 @@ namespace OpenRA.Mods.Common.Traits if (!self.IsAtGroundLevel()) return; - var actors = self.World.ActorMap.GetActorsAt(ToCell).Where(a => a != self).ToList(); + var actors = self.World.ActorMap.GetActorsAt(ToCell, ToSubCell).Where(a => a != self).ToList(); if (!AnyCrushables(actors)) return; diff --git a/OpenRA.Mods.Common/Traits/World/Locomotor.cs b/OpenRA.Mods.Common/Traits/World/Locomotor.cs index 2c8da603ad..6ea5b1993e 100644 --- a/OpenRA.Mods.Common/Traits/World/Locomotor.cs +++ b/OpenRA.Mods.Common/Traits/World/Locomotor.cs @@ -282,8 +282,8 @@ namespace OpenRA.Mods.Common.Traits if (check <= BlockedByActor.Immovable && !cellCache.Immovable.Overlaps(actor.Owner.PlayerMask)) return true; - // Cache doesn't account for ignored actors or temporary blockers - these must use the slow path. - if (ignoreActor == null && !cellFlag.HasCellFlag(CellFlag.HasTemporaryBlocker)) + // Cache doesn't account for ignored actors, temporary blockers, or subcells - these must use the slow path. + if (ignoreActor == null && !cellFlag.HasCellFlag(CellFlag.HasTemporaryBlocker) && subCell == SubCell.FullCell) { // We already know there are uncrushable actors in the cell so we are always blocked. if (check == BlockedByActor.All)