Skip to content

Commit 90b207d

Browse files
committed
refactor: Convert fix into a standalone block
1 parent 206aaec commit 90b207d

2 files changed

Lines changed: 10 additions & 8 deletions

File tree

Generals/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6272,13 +6272,14 @@ StateReturnType AIExitState::update()
62726272
//GS. The goal of unified ExitInterfaces dies a horrible death. I can't ask Object for the exit,
62736273
// as removeFromContain is only in the Contain type. I'm splitting the names in shame.
62746274
ExitInterface* goalExitInterface = goal->getContain() ? goal->getContain()->getContainExitInterface() : nullptr;
6275-
#if RETAIL_COMPATIBLE_CRC
62766275
if( goalExitInterface == nullptr )
6277-
#else
6276+
return STATE_FAILURE;
6277+
6278+
#if !RETAIL_COMPATIBLE_CRC
62786279
// TheSuperHackers @bugfix Stubbjax 03/05/2026 Stop trying to exit if the container is dead, as we are already ejected.
6279-
if (goalExitInterface == nullptr || goal->isEffectivelyDead())
6280-
#endif
6280+
if (goal->isEffectivelyDead())
62816281
return STATE_FAILURE;
6282+
#endif
62826283

62836284
if( goalExitInterface->isExitBusy() )
62846285
return STATE_CONTINUE;// Just wait a sec.

GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIStates.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6484,13 +6484,14 @@ StateReturnType AIExitState::update()
64846484
//GS. The goal of unified ExitInterfaces dies a horrible death. I can't ask Object for the exit,
64856485
// as removeFromContain is only in the Contain type. I'm splitting the names in shame.
64866486
ExitInterface* goalExitInterface = goal->getContain() ? goal->getContain()->getContainExitInterface() : nullptr;
6487-
#if RETAIL_COMPATIBLE_CRC
64886487
if( goalExitInterface == nullptr )
6489-
#else
6488+
return STATE_FAILURE;
6489+
6490+
#if !RETAIL_COMPATIBLE_CRC
64906491
// TheSuperHackers @bugfix Stubbjax 03/05/2026 Stop trying to exit if the container is dead, as we are already ejected.
6491-
if (goalExitInterface == nullptr || goal->isEffectivelyDead())
6492-
#endif
6492+
if (goal->isEffectivelyDead())
64936493
return STATE_FAILURE;
6494+
#endif
64946495

64956496
if( goalExitInterface->isExitBusy() )
64966497
return STATE_CONTINUE;// Just wait a sec.

0 commit comments

Comments
 (0)