Add support for queuing AttackMove orders.

This commit is contained in:
Paul Chote
2017-07-23 17:54:17 +01:00
committed by Matthias Mailänder
parent 2bfc7cdd46
commit f4f27f8980
2 changed files with 6 additions and 2 deletions

View File

@@ -49,8 +49,10 @@ namespace OpenRA.Orders
if (mi.Button == ExpectedButton && world.Map.Contains(cell))
{
world.CancelInputMode();
var queued = mi.Modifiers.HasModifier(Modifiers.Shift);
foreach (var subject in Subjects)
yield return new Order(OrderName, subject, false) { TargetLocation = cell };
yield return new Order(OrderName, subject, queued) { TargetLocation = cell };
}
}

View File

@@ -47,7 +47,6 @@ namespace OpenRA.Mods.Common.Traits
void Activate(Actor self)
{
self.CancelActivity();
self.QueueActivity(new AttackMoveActivity(self, move.MoveTo(TargetLocation.Value, 1)));
}
@@ -64,6 +63,9 @@ namespace OpenRA.Mods.Common.Traits
if (order.OrderString == "AttackMove")
{
if (!order.Queued)
self.CancelActivity();
TargetLocation = move.NearestMoveableCell(order.TargetLocation);
self.SetTargetLine(Target.FromCell(self.World, TargetLocation.Value), Color.Red);
Activate(self);