diff --git a/OpenRA.Mods.RA/Activities/Attack.cs b/OpenRA.Mods.RA/Activities/Attack.cs index b4ede1f858..5dafb7ed9c 100755 --- a/OpenRA.Mods.RA/Activities/Attack.cs +++ b/OpenRA.Mods.RA/Activities/Attack.cs @@ -24,6 +24,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) { @@ -33,6 +34,7 @@ namespace OpenRA.Mods.RA.Activities attack = self.Trait(); facing = self.Trait(); + positionable = self.Trait(); move = allowMovement ? self.TraitOrDefault() : null; } @@ -52,6 +54,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