Skip to content

Commit 46b5788

Browse files
committed
bugfix: Do not show veterancy effects for dead units
1 parent f4608df commit 46b5788

File tree

2 files changed

+20
-0
lines changed
  • GeneralsMD/Code/GameEngine/Source/GameLogic/Object
  • Generals/Code/GameEngine/Source/GameLogic/Object

2 files changed

+20
-0
lines changed

Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2789,6 +2789,11 @@ Bool Object::hasSpecialPower( SpecialPowerType type ) const
27892789
//-------------------------------------------------------------------------------------------------
27902790
void Object::onVeterancyLevelChanged( VeterancyLevel oldLevel, VeterancyLevel newLevel, Bool provideFeedback )
27912791
{
2792+
#if !RETAIL_COMPATIBLE_CRC
2793+
if (isEffectivelyDead())
2794+
return;
2795+
#endif
2796+
27922797
updateUpgradeModules();
27932798

27942799
const UpgradeTemplate* up = TheUpgradeCenter->findVeterancyUpgrade(newLevel);
@@ -2843,6 +2848,11 @@ void Object::onVeterancyLevelChanged( VeterancyLevel oldLevel, VeterancyLevel ne
28432848
&& outerDrawable
28442849
&& outerDrawable->isVisible();
28452850

2851+
#if RETAIL_COMPATIBLE_CRC
2852+
if (isEffectivelyDead())
2853+
return;
2854+
#endif
2855+
28462856
if( doAnimation && TheGameLogic->getDrawIconUI() )
28472857
{
28482858
if( TheAnim2DCollection && TheGlobalData->m_levelGainAnimationName.isEmpty() == FALSE )

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3104,6 +3104,11 @@ Bool Object::hasAnySpecialPower() const
31043104
//-------------------------------------------------------------------------------------------------
31053105
void Object::onVeterancyLevelChanged( VeterancyLevel oldLevel, VeterancyLevel newLevel, Bool provideFeedback )
31063106
{
3107+
#if !RETAIL_COMPATIBLE_CRC
3108+
if (isEffectivelyDead())
3109+
return;
3110+
#endif
3111+
31073112
updateUpgradeModules();
31083113

31093114
const UpgradeTemplate* up = TheUpgradeCenter->findVeterancyUpgrade(newLevel);
@@ -3158,6 +3163,11 @@ void Object::onVeterancyLevelChanged( VeterancyLevel oldLevel, VeterancyLevel ne
31583163
&& outerDrawable
31593164
&& outerDrawable->isVisible();
31603165

3166+
#if RETAIL_COMPATIBLE_CRC
3167+
if (isEffectivelyDead())
3168+
return;
3169+
#endif
3170+
31613171
if( doAnimation && TheGameLogic->getDrawIconUI() )
31623172
{
31633173
if( TheAnim2DCollection && TheGlobalData->m_levelGainAnimationName.isEmpty() == FALSE )

0 commit comments

Comments
 (0)