Prefer target to lastVisible target if it is visible.
This commit is contained in:
@@ -195,8 +195,10 @@ namespace OpenRA.Mods.Common.Activities
|
|||||||
return AttackStatus.UnableToAttack;
|
return AttackStatus.UnableToAttack;
|
||||||
|
|
||||||
attackStatus |= AttackStatus.NeedsToMove;
|
attackStatus |= AttackStatus.NeedsToMove;
|
||||||
|
|
||||||
|
var checkTarget = useLastVisibleTarget ? lastVisibleTarget : target;
|
||||||
moveActivity = ActivityUtils.SequenceActivities(
|
moveActivity = ActivityUtils.SequenceActivities(
|
||||||
move.MoveWithinRange(target, minRange, maxRange, lastVisibleTarget.CenterPosition, Color.Red),
|
move.MoveWithinRange(target, minRange, maxRange, checkTarget.CenterPosition, Color.Red),
|
||||||
this);
|
this);
|
||||||
|
|
||||||
return AttackStatus.NeedsToMove;
|
return AttackStatus.NeedsToMove;
|
||||||
|
|||||||
Reference in New Issue
Block a user