Skip to content

Commit 05e518d

Browse files
authored
bugfix(contain): Abort containee's AIExitState if its container object dies (TheSuperHackers#2513)
1 parent c8b5f61 commit 05e518d

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6275,6 +6275,12 @@ StateReturnType AIExitState::update()
62756275
if( goalExitInterface == nullptr )
62766276
return STATE_FAILURE;
62776277

6278+
#if !RETAIL_COMPATIBLE_CRC
6279+
// TheSuperHackers @bugfix Stubbjax 03/05/2026 Stop trying to exit if the container is dead, as we are already ejected.
6280+
if (goal->isEffectivelyDead())
6281+
return STATE_FAILURE;
6282+
#endif
6283+
62786284
if( goalExitInterface->isExitBusy() )
62796285
return STATE_CONTINUE;// Just wait a sec.
62806286

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6487,6 +6487,12 @@ StateReturnType AIExitState::update()
64876487
if( goalExitInterface == nullptr )
64886488
return STATE_FAILURE;
64896489

6490+
#if !RETAIL_COMPATIBLE_CRC
6491+
// TheSuperHackers @bugfix Stubbjax 03/05/2026 Stop trying to exit if the container is dead, as we are already ejected.
6492+
if (goal->isEffectivelyDead())
6493+
return STATE_FAILURE;
6494+
#endif
6495+
64906496
if( goalExitInterface->isExitBusy() )
64916497
return STATE_CONTINUE;// Just wait a sec.
64926498

0 commit comments

Comments
 (0)