From f4f27f898069d78cea128fe6f80bd3471c86116c Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sun, 23 Jul 2017 17:54:17 +0100 Subject: [PATCH] Add support for queuing AttackMove orders. --- OpenRA.Game/Orders/GenericSelectTarget.cs | 4 +++- OpenRA.Mods.Common/Traits/AttackMove.cs | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/OpenRA.Game/Orders/GenericSelectTarget.cs b/OpenRA.Game/Orders/GenericSelectTarget.cs index 71c5a50353..6633fa9fea 100644 --- a/OpenRA.Game/Orders/GenericSelectTarget.cs +++ b/OpenRA.Game/Orders/GenericSelectTarget.cs @@ -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 }; } } diff --git a/OpenRA.Mods.Common/Traits/AttackMove.cs b/OpenRA.Mods.Common/Traits/AttackMove.cs index 80da2181c3..e447a2a0d2 100644 --- a/OpenRA.Mods.Common/Traits/AttackMove.cs +++ b/OpenRA.Mods.Common/Traits/AttackMove.cs @@ -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);