From b98e7f3b5b2395570fff5a2e03c821dc1521ceb8 Mon Sep 17 00:00:00 2001 From: Atrik Date: Tue, 25 Nov 2025 14:02:34 +0100 Subject: [PATCH] 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 --- .../mods/public/simulation/components/UnitAI.js | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/binaries/data/mods/public/simulation/components/UnitAI.js b/binaries/data/mods/public/simulation/components/UnitAI.js index c6e2d0a428..77466d14da 100644 --- a/binaries/data/mods/public/simulation/components/UnitAI.js +++ b/binaries/data/mods/public/simulation/components/UnitAI.js @@ -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.