Fix worms getting stuck when target reaches rock

This commit is contained in:
penev92
2014-12-14 02:32:01 +02:00
parent 299a933dac
commit fbda9dc1b1

View File

@@ -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<AttackBase>();
facing = self.Trait<IFacing>();
positionable = self.Trait<IPositionable>();
move = allowMovement ? self.TraitOrDefault<IMove>() : 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