Skip to content

Commit 25c541d

Browse files
committed
tweak: Cleaner solution
1 parent 9c16290 commit 25c541d

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Body/ActiveBody.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ void ActiveBody::attemptDamage( DamageInfo *damageInfo )
494494

495495
Bool wasSubdued = isSubdued();
496496
internalAddSubdualDamage(amount);
497-
Bool nowSubdued = isSubdued();
497+
Bool nowSubdued = m_maxHealth <= m_currentSubdualDamage;
498498
alreadyHandled = TRUE;
499499
allowModifier = FALSE;
500500

@@ -929,12 +929,6 @@ void ActiveBody::setMaxHealth( Real maxHealth, MaxHealthChangeType healthChangeT
929929
internalChangeHealth(m_maxHealth - m_currentHealth);
930930
break;
931931
}
932-
933-
#if !RETAIL_COMPATIBLE_CRC
934-
// TheSuperHackers @bugfix Stubbjax 20/09/2025 Prevent indefinite subdue status when internally shifting health across the threshold.
935-
if (isSubdued())
936-
internalAddSubdualDamage(m_maxHealth - getCurrentSubdualDamageAmount());
937-
#endif
938932
}
939933

940934
//
@@ -1319,7 +1313,12 @@ void ActiveBody::onSubdualChange( Bool isNowSubdued )
13191313
//-------------------------------------------------------------------------------------------------
13201314
Bool ActiveBody::isSubdued() const
13211315
{
1316+
#if RETAIL_COMPATIBLE_CRC
13221317
return m_maxHealth <= m_currentSubdualDamage;
1318+
#else
1319+
// TheSuperHackers @bugfix Stubbjax 20/09/2025 Prevent indefinite subdue status when internally shifting health across the threshold.
1320+
return getObject()->isDisabledByType(DISABLED_SUBDUED);
1321+
#endif
13231322
}
13241323

13251324
//-------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)