From 9b29c058c13bc9a955fb362bcbb8aeea2b236822 Mon Sep 17 00:00:00 2001 From: Caball009 <82909616+Caball009@users.noreply.github.com> Date: Mon, 27 Jul 2026 13:14:41 +0200 Subject: [PATCH] bugfix(ai): Prevent units from deploying when moving. --- .../Object/Update/AIUpdate/DeployStyleAIUpdate.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DeployStyleAIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DeployStyleAIUpdate.cpp index ebc018ce8d5..e591f49105b 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DeployStyleAIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/DeployStyleAIUpdate.cpp @@ -143,7 +143,14 @@ UpdateSleepTime DeployStyleAIUpdate::update() } } - if( isInRange || isInGuardIdleState ) + // TheSuperHackers @bugfix Caball009 27/07/2026 The pathfinding code may use a stricter attack range check than used + // in this function, so the range check is insufficient. Objects are not allowed to deploy and attack if they're moving. +#if RETAIL_COMPATIBLE_CRC + if (isInRange || isInGuardIdleState) +#else + // @todo Simplify the code by moving the second branch up so 'isTryingToMove' is checked first. + if (!isTryingToMove && (isInRange || isInGuardIdleState)) +#endif { switch( m_state ) {