mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-17 22:03:56 -07:00
Fix issues with formation + packing.
-e7e218a3bccontained a small mistake: this.order wasn't cleared when clearing the orderqueue, which led to a broken codepath in PushOrderFront. - Since71a61d5f50, formation orders their members to reform in IDLE. This will automatically pack any unpacked siege. Reported by: langbart Tested by: langbart Fixes #6018 Differential Revision: https://code.wildfiregames.com/D3561 This was SVN commit r24895.
This commit is contained in:
parent
18bc3e47ea
commit
674cdae166
1 changed files with 11 additions and 0 deletions
|
|
@ -231,6 +231,14 @@ UnitAI.prototype.UnitFsmSpec = {
|
|||
|
||||
if (this.CanPack())
|
||||
{
|
||||
// If the controller is IDLE, this is just the regular reformation timer.
|
||||
// In that case we don't actually want to move, as that would unpack us.
|
||||
let cmpControllerAI = Engine.QueryInterface(this.GetFormationController(), IID_UnitAI);
|
||||
if (cmpControllerAI.IsIdle())
|
||||
{
|
||||
this.FinishOrder();
|
||||
return;
|
||||
}
|
||||
this.PushOrderFront("Pack", { "force": true });
|
||||
return;
|
||||
}
|
||||
|
|
@ -4172,7 +4180,10 @@ UnitAI.prototype.ReplaceOrder = function(type, data)
|
|||
// (this is needed to support queued no-formation orders).
|
||||
let idx = this.orderQueue.findIndex(o => o.type == "LeaveFormation");
|
||||
if (idx === -1)
|
||||
{
|
||||
this.orderQueue = [];
|
||||
this.order = undefined;
|
||||
}
|
||||
else
|
||||
this.orderQueue.splice(0, idx);
|
||||
this.PushOrderFront(type, data);
|
||||
|
|
|
|||
Loading…
Reference in a new issue