1
0
forked from mirrors/0ad

Fix formation combat stop command bug

Remove the ResetIdle method that was causing issues with the
'Stop units' command in formation combat

The method was originally added to prevent formation members
from appearing idle during patrol waypoints, but formation
controllers or its members no longer enter idle states
even without it

The ResetIdle method was sending MT_UnitIdleChanged messages
causing formation members to bug when using stop commands

Fixes: #8546
This commit is contained in:
Atrik
2025-11-25 14:02:34 +01:00
committed by Vantha
parent be6670df89
commit b98e7f3b5b
@@ -996,7 +996,6 @@ UnitAI.prototype.UnitFsmSpec = {
// Start the timer on the next turn to catch up with potential stragglers.
this.StartTimer(100, 2000);
this.isIdle = true;
this.CallMemberFunction("ResetIdle");
return false;
},
@@ -3514,18 +3513,6 @@ UnitAI.prototype.IsIdle = function()
return this.isIdle;
};
/**
* Used by formation controllers to toggle the idleness of their members.
*/
UnitAI.prototype.ResetIdle = function()
{
const shouldBeIdle = this.GetCurrentState().endsWith(".IDLE");
if (this.isIdle == shouldBeIdle)
return;
this.isIdle = shouldBeIdle;
Engine.PostMessage(this.entity, MT_UnitIdleChanged, { "idle": this.isIdle });
};
UnitAI.prototype.SetGarrisoned = function()
{
// UnitAI caches its own garrisoned state for performance.