Fix worms getting stuck when target reaches rock
This commit is contained in:
@@ -23,6 +23,7 @@ namespace OpenRA.Mods.RA.Activities
|
|||||||
readonly IFacing facing;
|
readonly IFacing facing;
|
||||||
readonly WRange minRange;
|
readonly WRange minRange;
|
||||||
readonly WRange maxRange;
|
readonly WRange maxRange;
|
||||||
|
readonly IPositionable positionable;
|
||||||
|
|
||||||
public Attack(Actor self, Target target, WRange minRange, WRange maxRange, bool allowMovement)
|
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>();
|
attack = self.Trait<AttackBase>();
|
||||||
facing = self.Trait<IFacing>();
|
facing = self.Trait<IFacing>();
|
||||||
|
positionable = self.Trait<IPositionable>();
|
||||||
|
|
||||||
move = allowMovement ? self.TraitOrDefault<IMove>() : null;
|
move = allowMovement ? self.TraitOrDefault<IMove>() : null;
|
||||||
}
|
}
|
||||||
@@ -52,6 +54,9 @@ namespace OpenRA.Mods.RA.Activities
|
|||||||
if (!Target.IsValidFor(self) || type == TargetType.FrozenActor)
|
if (!Target.IsValidFor(self) || type == TargetType.FrozenActor)
|
||||||
return NextActivity;
|
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.
|
// Drop the target if it moves under the shroud / fog.
|
||||||
// HACK: This would otherwise break targeting frozen actors
|
// HACK: This would otherwise break targeting frozen actors
|
||||||
// The problem is that Shroud.IsTargetable returns false (as it should) for
|
// The problem is that Shroud.IsTargetable returns false (as it should) for
|
||||||
|
|||||||
Reference in New Issue
Block a user