diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/InstantDeathBehavior.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/InstantDeathBehavior.cpp index aa3126b588e..d3f4de7d72a 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/InstantDeathBehavior.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/InstantDeathBehavior.cpp @@ -124,6 +124,7 @@ void InstantDeathBehavior::onDie( const DamageInfo *damageInfo ) if (!isDieApplicable(damageInfo)) return; +#if RETAIL_COMPATIBLE_CRC AIUpdateInterface* ai = getObject()->getAIUpdateInterface(); if (ai) { @@ -132,6 +133,7 @@ void InstantDeathBehavior::onDie( const DamageInfo *damageInfo ) return; ai->markAsDead(); } +#endif const InstantDeathBehaviorModuleData* d = getInstantDeathBehaviorModuleData(); @@ -170,6 +172,19 @@ void InstantDeathBehavior::onDie( const DamageInfo *damageInfo ) } } +#if !RETAIL_COMPATIBLE_CRC + // TheSuperHackers @bugfix Stubbjax 21/07/2026 Allow multiple InstantDeathBehaviors to be processed. + // Multiple FXListDie, CreateObjectDie and FireWeaponWhenDeadBehavior modules are already supported. + AIUpdateInterface* ai = getObject()->getAIUpdateInterface(); + if (ai) + { + // has another AI already handled us. (hopefully another InstantDeathBehavior) + if (ai->isAiInDeadState()) + return; + ai->markAsDead(); + } +#endif + TheGameLogic->destroyObject(getObject()); } diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/InstantDeathBehavior.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/InstantDeathBehavior.cpp index cc2695115a4..5d852c78606 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/InstantDeathBehavior.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/InstantDeathBehavior.cpp @@ -124,6 +124,7 @@ void InstantDeathBehavior::onDie( const DamageInfo *damageInfo ) if (!isDieApplicable(damageInfo)) return; +#if RETAIL_COMPATIBLE_CRC AIUpdateInterface* ai = getObject()->getAIUpdateInterface(); if (ai) { @@ -132,6 +133,7 @@ void InstantDeathBehavior::onDie( const DamageInfo *damageInfo ) return; ai->markAsDead(); } +#endif const InstantDeathBehaviorModuleData* d = getInstantDeathBehaviorModuleData(); @@ -170,6 +172,19 @@ void InstantDeathBehavior::onDie( const DamageInfo *damageInfo ) } } +#if !RETAIL_COMPATIBLE_CRC + // TheSuperHackers @bugfix Stubbjax 21/07/2026 Allow multiple InstantDeathBehaviors to be processed. + // Multiple FXListDie, CreateObjectDie and FireWeaponWhenDeadBehavior modules are already supported. + AIUpdateInterface* ai = getObject()->getAIUpdateInterface(); + if (ai) + { + // has another AI already handled us. (hopefully another InstantDeathBehavior) + if (ai->isAiInDeadState()) + return; + ai->markAsDead(); + } +#endif + TheGameLogic->destroyObject(getObject()); }