From eb09fa18707f7810b1ceb3889757bae22d3fc06b Mon Sep 17 00:00:00 2001 From: Mauller <26652186+Mauller@users.noreply.github.com> Date: Mon, 14 Jul 2025 21:00:39 +0100 Subject: [PATCH] [GEN][ZH] Fix hacking hackers packing and unpacking when ordered to hack the Internet --- .../Update/AIUpdate/HackInternetAIUpdate.cpp | 14 ++++++++++++-- .../Update/AIUpdate/HackInternetAIUpdate.cpp | 14 ++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/HackInternetAIUpdate.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/HackInternetAIUpdate.cpp index 64f245abf0..ebd5c224df 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/HackInternetAIUpdate.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/HackInternetAIUpdate.cpp @@ -126,16 +126,26 @@ void HackInternetAIUpdate::aiDoCommand(const AICommandParms* parms) if (!isAllowedToRespondToAiCommands(parms)) return; + const StateID currentState = getStateMachine()->getCurrentStateID(); + +#if !RETAIL_COMPATIBLE_CRC + // TheSuperHackers @bugfix andrew-2e128 / Mauller 14/07/2025 prevent hacking hackers packing and unpacking when commanded to hack the internet + if (parms->m_cmd == AICMD_HACK_INTERNET && ( currentState == HACK_INTERNET || currentState == UNPACKING ) ) + { + return; + } +#endif + //If our hacker is currently packing up his gear, we need to prevent him //from moving until completed. In order to accomplish this, we'll detect, //then - if( getStateMachine()->getCurrentStateID() == HACK_INTERNET || getStateMachine()->getCurrentStateID() == PACKING ) + if( currentState == HACK_INTERNET || currentState == PACKING ) { // nuke any existing pending cmd m_pendingCommand.store(*parms); m_hasPendingCommand = true; - if( getStateMachine()->getCurrentStateID() == HACK_INTERNET ) + if( currentState == HACK_INTERNET ) { getStateMachine()->clear(); setLastCommandSource( CMD_FROM_AI ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/HackInternetAIUpdate.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/HackInternetAIUpdate.cpp index c5b1e0cfc7..d2f929df29 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/HackInternetAIUpdate.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/HackInternetAIUpdate.cpp @@ -126,16 +126,26 @@ void HackInternetAIUpdate::aiDoCommand(const AICommandParms* parms) if (!isAllowedToRespondToAiCommands(parms)) return; + const StateID currentState = getStateMachine()->getCurrentStateID(); + +#if !RETAIL_COMPATIBLE_CRC + // TheSuperHackers @bugfix andrew-2e128 / Mauller 14/07/2025 prevent hacking hackers packing and unpacking when commanded to hack the internet + if (parms->m_cmd == AICMD_HACK_INTERNET && ( currentState == HACK_INTERNET || currentState == UNPACKING ) ) + { + return; + } +#endif + //If our hacker is currently packing up his gear, we need to prevent him //from moving until completed. In order to accomplish this, we'll detect, //then - if( getStateMachine()->getCurrentStateID() == HACK_INTERNET || getStateMachine()->getCurrentStateID() == PACKING ) + if( currentState == HACK_INTERNET || currentState == PACKING ) { // nuke any existing pending cmd m_pendingCommand.store(*parms); m_hasPendingCommand = true; - if( getStateMachine()->getCurrentStateID() == HACK_INTERNET ) + if( currentState == HACK_INTERNET ) { getStateMachine()->clear(); setLastCommandSource( CMD_FROM_AI );