Merge pull request #5327 from Mailaender/idle-orderlines

Removed flickering order lines when selecting idle actors
This commit is contained in:
Paul Chote
2014-05-17 18:19:44 +12:00
2 changed files with 4 additions and 1 deletions

View File

@@ -51,6 +51,9 @@ namespace OpenRA.Traits
public void Selected(Actor a) public void Selected(Actor a)
{ {
if (a.IsIdle)
return;
// Reset the order line timeout. // Reset the order line timeout.
lifetime = Info.Ticks; lifetime = Info.Ticks;
} }

View File

@@ -44,7 +44,6 @@ namespace OpenRA.Mods.RA
{ {
self.CancelActivity(); self.CancelActivity();
self.QueueActivity(new AttackMoveActivity(self, move.MoveTo(TargetLocation.Value, 1))); self.QueueActivity(new AttackMoveActivity(self, move.MoveTo(TargetLocation.Value, 1)));
self.SetTargetLine(Target.FromCell(TargetLocation.Value), Color.Red);
} }
public void TickIdle(Actor self) public void TickIdle(Actor self)
@@ -60,6 +59,7 @@ namespace OpenRA.Mods.RA
if (order.OrderString == "AttackMove") if (order.OrderString == "AttackMove")
{ {
TargetLocation = move.NearestMoveableCell(order.TargetLocation); TargetLocation = move.NearestMoveableCell(order.TargetLocation);
self.SetTargetLine(Target.FromCell(TargetLocation.Value), Color.Red);
Activate(self); Activate(self);
} }
} }