diff --git a/OpenRA.Game/Orders/GenericSelectTarget.cs b/OpenRA.Game/Orders/GenericSelectTarget.cs index 656daa1d68..6dd8b47f41 100644 --- a/OpenRA.Game/Orders/GenericSelectTarget.cs +++ b/OpenRA.Game/Orders/GenericSelectTarget.cs @@ -10,7 +10,7 @@ #endregion using System.Collections.Generic; -using OpenRA.Graphics; +using System.Linq; using OpenRA.Traits; namespace OpenRA.Orders @@ -53,8 +53,7 @@ namespace OpenRA.Orders world.CancelInputMode(); var queued = mi.Modifiers.HasModifier(Modifiers.Shift); - foreach (var subject in Subjects) - yield return new Order(OrderName, subject, Target.FromCell(world, cell), queued); + yield return new Order(OrderName, null, Target.FromCell(world, cell), queued, null, Subjects.ToArray()); } } diff --git a/OpenRA.Mods.Common/Orders/GuardOrderGenerator.cs b/OpenRA.Mods.Common/Orders/GuardOrderGenerator.cs index 5bd1c49f1c..5b1ead6684 100644 --- a/OpenRA.Mods.Common/Orders/GuardOrderGenerator.cs +++ b/OpenRA.Mods.Common/Orders/GuardOrderGenerator.cs @@ -34,9 +34,7 @@ namespace OpenRA.Mods.Common.Orders world.CancelInputMode(); var queued = mi.Modifiers.HasModifier(Modifiers.Shift); - foreach (var subject in Subjects) - if (subject != target) - yield return new Order(OrderName, subject, Target.FromActor(target), queued); + yield return new Order(OrderName, null, Target.FromActor(target), queued, null, Subjects.Where(s => s != target).ToArray()); } public override void Tick(World world) diff --git a/OpenRA.Mods.Common/Traits/AttackMove.cs b/OpenRA.Mods.Common/Traits/AttackMove.cs index 6f6f6c5013..dc04da5684 100644 --- a/OpenRA.Mods.Common/Traits/AttackMove.cs +++ b/OpenRA.Mods.Common/Traits/AttackMove.cs @@ -117,8 +117,7 @@ namespace OpenRA.Mods.Common.Traits // Cells outside the playable area should be clamped to the edge for consistency with move orders cell = world.Map.Clamp(cell); - foreach (var s in subjects) - yield return new Order(orderName, s.Actor, Target.FromCell(world, cell), queued); + yield return new Order(orderName, null, Target.FromCell(world, cell), queued, null, subjects.Select(s => s.Actor).ToArray()); } }