Skip to content

Commit 11f49db

Browse files
authored
[GEN][ZH] Fix China Hackers unnecessarily packing and unpacking when ordered to hack while already hacking (#1280)
1 parent 16c50f7 commit 11f49db

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

Generals/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/HackInternetAIUpdate.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,16 +126,26 @@ void HackInternetAIUpdate::aiDoCommand(const AICommandParms* parms)
126126
if (!isAllowedToRespondToAiCommands(parms))
127127
return;
128128

129+
const StateID currentState = getStateMachine()->getCurrentStateID();
130+
131+
#if !RETAIL_COMPATIBLE_CRC
132+
// TheSuperHackers @bugfix andrew-2e128 / Mauller 14/07/2025 prevent hacking hackers packing and unpacking when commanded to hack the internet
133+
if (parms->m_cmd == AICMD_HACK_INTERNET && ( currentState == HACK_INTERNET || currentState == UNPACKING ) )
134+
{
135+
return;
136+
}
137+
#endif
138+
129139
//If our hacker is currently packing up his gear, we need to prevent him
130140
//from moving until completed. In order to accomplish this, we'll detect,
131141
//then
132-
if( getStateMachine()->getCurrentStateID() == HACK_INTERNET || getStateMachine()->getCurrentStateID() == PACKING )
142+
if( currentState == HACK_INTERNET || currentState == PACKING )
133143
{
134144
// nuke any existing pending cmd
135145
m_pendingCommand.store(*parms);
136146
m_hasPendingCommand = true;
137147

138-
if( getStateMachine()->getCurrentStateID() == HACK_INTERNET )
148+
if( currentState == HACK_INTERNET )
139149
{
140150
getStateMachine()->clear();
141151
setLastCommandSource( CMD_FROM_AI );

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Update/AIUpdate/HackInternetAIUpdate.cpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,16 +126,26 @@ void HackInternetAIUpdate::aiDoCommand(const AICommandParms* parms)
126126
if (!isAllowedToRespondToAiCommands(parms))
127127
return;
128128

129+
const StateID currentState = getStateMachine()->getCurrentStateID();
130+
131+
#if !RETAIL_COMPATIBLE_CRC
132+
// TheSuperHackers @bugfix andrew-2e128 / Mauller 14/07/2025 prevent hacking hackers packing and unpacking when commanded to hack the internet
133+
if (parms->m_cmd == AICMD_HACK_INTERNET && ( currentState == HACK_INTERNET || currentState == UNPACKING ) )
134+
{
135+
return;
136+
}
137+
#endif
138+
129139
//If our hacker is currently packing up his gear, we need to prevent him
130140
//from moving until completed. In order to accomplish this, we'll detect,
131141
//then
132-
if( getStateMachine()->getCurrentStateID() == HACK_INTERNET || getStateMachine()->getCurrentStateID() == PACKING )
142+
if( currentState == HACK_INTERNET || currentState == PACKING )
133143
{
134144
// nuke any existing pending cmd
135145
m_pendingCommand.store(*parms);
136146
m_hasPendingCommand = true;
137147

138-
if( getStateMachine()->getCurrentStateID() == HACK_INTERNET )
148+
if( currentState == HACK_INTERNET )
139149
{
140150
getStateMachine()->clear();
141151
setLastCommandSource( CMD_FROM_AI );

0 commit comments

Comments
 (0)