Make attack moving and guarding use a grouped order
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using OpenRA.Graphics;
|
using System.Linq;
|
||||||
using OpenRA.Traits;
|
using OpenRA.Traits;
|
||||||
|
|
||||||
namespace OpenRA.Orders
|
namespace OpenRA.Orders
|
||||||
@@ -53,8 +53,7 @@ namespace OpenRA.Orders
|
|||||||
world.CancelInputMode();
|
world.CancelInputMode();
|
||||||
|
|
||||||
var queued = mi.Modifiers.HasModifier(Modifiers.Shift);
|
var queued = mi.Modifiers.HasModifier(Modifiers.Shift);
|
||||||
foreach (var subject in Subjects)
|
yield return new Order(OrderName, null, Target.FromCell(world, cell), queued, null, Subjects.ToArray());
|
||||||
yield return new Order(OrderName, subject, Target.FromCell(world, cell), queued);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,9 +34,7 @@ namespace OpenRA.Mods.Common.Orders
|
|||||||
world.CancelInputMode();
|
world.CancelInputMode();
|
||||||
|
|
||||||
var queued = mi.Modifiers.HasModifier(Modifiers.Shift);
|
var queued = mi.Modifiers.HasModifier(Modifiers.Shift);
|
||||||
foreach (var subject in Subjects)
|
yield return new Order(OrderName, null, Target.FromActor(target), queued, null, Subjects.Where(s => s != target).ToArray());
|
||||||
if (subject != target)
|
|
||||||
yield return new Order(OrderName, subject, Target.FromActor(target), queued);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Tick(World world)
|
public override void Tick(World world)
|
||||||
|
|||||||
@@ -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
|
// Cells outside the playable area should be clamped to the edge for consistency with move orders
|
||||||
cell = world.Map.Clamp(cell);
|
cell = world.Map.Clamp(cell);
|
||||||
foreach (var s in subjects)
|
yield return new Order(orderName, null, Target.FromCell(world, cell), queued, null, subjects.Select(s => s.Actor).ToArray());
|
||||||
yield return new Order(orderName, s.Actor, Target.FromCell(world, cell), queued);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user