diff --git a/OpenRA.Mods.RA/Activities/Attack.cs b/OpenRA.Mods.RA/Activities/Attack.cs index 671436eb40..818c34267b 100755 --- a/OpenRA.Mods.RA/Activities/Attack.cs +++ b/OpenRA.Mods.RA/Activities/Attack.cs @@ -23,6 +23,7 @@ namespace OpenRA.Mods.RA.Activities readonly IFacing facing; readonly WRange minRange; readonly WRange maxRange; + readonly IPositionable positionable; public Attack(Actor self, Target target, WRange minRange, WRange maxRange, bool allowMovement) { @@ -32,6 +33,7 @@ namespace OpenRA.Mods.RA.Activities attack = self.Trait(); facing = self.Trait(); + positionable = self.Trait(); move = allowMovement ? self.TraitOrDefault() : null; } @@ -51,6 +53,9 @@ namespace OpenRA.Mods.RA.Activities var type = Target.Type; if (!Target.IsValidFor(self) || type == TargetType.FrozenActor) return NextActivity; + + if (attack.Info.AttackRequiresEnteringCell && !positionable.CanEnterCell(Target.Actor.Location, null, false)) + return NextActivity; // Drop the target if it moves under the shroud / fog. // HACK: This would otherwise break targeting frozen actors