Prefer target to lastVisible target if it is visible.

This commit is contained in:
Paul Chote
2019-02-02 11:31:24 +00:00
committed by reaperrr
parent b466b5d660
commit 0a57fbda3c

View File

@@ -195,8 +195,10 @@ namespace OpenRA.Mods.Common.Activities
return AttackStatus.UnableToAttack;
attackStatus |= AttackStatus.NeedsToMove;
var checkTarget = useLastVisibleTarget ? lastVisibleTarget : target;
moveActivity = ActivityUtils.SequenceActivities(
move.MoveWithinRange(target, minRange, maxRange, lastVisibleTarget.CenterPosition, Color.Red),
move.MoveWithinRange(target, minRange, maxRange, checkTarget.CenterPosition, Color.Red),
this);
return AttackStatus.NeedsToMove;