Fix subcell crusher logic.

This commit is contained in:
Paul Chote
2020-01-26 13:23:28 +00:00
committed by reaperrr
parent 62af58c2e6
commit 85a5b6cc17
2 changed files with 3 additions and 3 deletions

View File

@@ -560,7 +560,7 @@ namespace OpenRA.Mods.Common.Traits
if (!self.IsAtGroundLevel()) if (!self.IsAtGroundLevel())
return; 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)) if (!AnyCrushables(actors))
return; return;

View File

@@ -282,8 +282,8 @@ namespace OpenRA.Mods.Common.Traits
if (check <= BlockedByActor.Immovable && !cellCache.Immovable.Overlaps(actor.Owner.PlayerMask)) if (check <= BlockedByActor.Immovable && !cellCache.Immovable.Overlaps(actor.Owner.PlayerMask))
return true; return true;
// Cache doesn't account for ignored actors or temporary blockers - these must use the slow path. // Cache doesn't account for ignored actors, temporary blockers, or subcells - these must use the slow path.
if (ignoreActor == null && !cellFlag.HasCellFlag(CellFlag.HasTemporaryBlocker)) 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. // We already know there are uncrushable actors in the cell so we are always blocked.
if (check == BlockedByActor.All) if (check == BlockedByActor.All)