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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user