diff --git a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/PoisonedBehavior.cpp b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/PoisonedBehavior.cpp index d9c446f248..57619735e2 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/PoisonedBehavior.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/Object/Behavior/PoisonedBehavior.cpp @@ -87,7 +87,15 @@ PoisonedBehavior::~PoisonedBehavior( void ) void PoisonedBehavior::onDamage( DamageInfo *damageInfo ) { if( damageInfo->in.m_damageType == DAMAGE_POISON ) + { +#if !RETAIL_COMPATIBLE_CRC + // TheSuperHackers @bugfix bobtista 11/17/2025 Ignore damage with INVALID_ID source to prevent infinite loop from DoT + if( damageInfo->in.m_sourceID != INVALID_ID ) + startPoisonedEffects( damageInfo ); +#else startPoisonedEffects( damageInfo ); +#endif + } } // ------------------------------------------------------------------------------------------------ @@ -118,8 +126,14 @@ UpdateSleepTime PoisonedBehavior::update() // If it is time to do damage, then do it and reset the damage timer DamageInfo damage; damage.in.m_amount = m_poisonDamageAmount; +#if !RETAIL_COMPATIBLE_CRC + // TheSuperHackers @bugfix bobtista 11/17/2025 Use INVALID_ID to prevent infinite loop while allowing poison resistance to work + damage.in.m_sourceID = INVALID_ID; + damage.in.m_damageType = DAMAGE_POISON; +#else damage.in.m_sourceID = m_poisonSource; damage.in.m_damageType = DAMAGE_UNRESISTABLE; // Not poison, as that will infect us again +#endif damage.in.m_deathType = m_deathType; getObject()->attemptDamage( &damage ); diff --git a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/PoisonedBehavior.cpp b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/PoisonedBehavior.cpp index 3c32fe58a7..ab0e1a8f57 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/PoisonedBehavior.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Behavior/PoisonedBehavior.cpp @@ -87,7 +87,15 @@ PoisonedBehavior::~PoisonedBehavior( void ) void PoisonedBehavior::onDamage( DamageInfo *damageInfo ) { if( damageInfo->in.m_damageType == DAMAGE_POISON ) + { +#if !RETAIL_COMPATIBLE_CRC + // TheSuperHackers @bugfix bobtista 11/17/2025 Ignore damage with INVALID_ID source to prevent infinite loop from DoT + if( damageInfo->in.m_sourceID != INVALID_ID ) + startPoisonedEffects( damageInfo ); +#else startPoisonedEffects( damageInfo ); +#endif + } } // ------------------------------------------------------------------------------------------------ @@ -118,9 +126,16 @@ UpdateSleepTime PoisonedBehavior::update() // If it is time to do damage, then do it and reset the damage timer DamageInfo damage; damage.in.m_amount = m_poisonDamageAmount; +#if !RETAIL_COMPATIBLE_CRC + // TheSuperHackers @bugfix bobtista 11/17/2025 Use INVALID_ID to prevent infinite loop while allowing poison resistance to work + damage.in.m_sourceID = INVALID_ID; + damage.in.m_damageType = DAMAGE_POISON; + damage.in.m_damageFXOverride = DAMAGE_POISON; +#else damage.in.m_sourceID = m_poisonSource; damage.in.m_damageType = DAMAGE_UNRESISTABLE; // Not poison, as that will infect us again damage.in.m_damageFXOverride = DAMAGE_POISON; // but this will ensure that the right effect is played +#endif damage.in.m_deathType = m_deathType; getObject()->attemptDamage( &damage );