Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Generals/Code/GameEngine/Include/GameLogic/Object.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ class Object : public Thing, public Snapshot

void scoreTheKill( const Object *victim ); ///< I just killed this object.
void onVeterancyLevelChanged( VeterancyLevel oldLevel, VeterancyLevel newLevel, Bool provideFeedback = TRUE ); ///< I just achieved this level right this moment
void createVeterancyLevelFX(VeterancyLevel oldLevel, VeterancyLevel newLevel);
ExperienceTracker* getExperienceTracker() {return m_experienceTracker;}
const ExperienceTracker* getExperienceTracker() const {return m_experienceTracker;}
VeterancyLevel getVeterancyLevel() const;
Expand Down
20 changes: 18 additions & 2 deletions Generals/Code/GameEngine/Source/GameLogic/Object/Object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2789,6 +2789,12 @@ Bool Object::hasSpecialPower( SpecialPowerType type ) const
//-------------------------------------------------------------------------------------------------
void Object::onVeterancyLevelChanged( VeterancyLevel oldLevel, VeterancyLevel newLevel, Bool provideFeedback )
{
#if !RETAIL_COMPATIBLE_CRC
// TheSuperHackers @bugfix Stubbjax 10/12/2025 Do not apply veterancy bonuses and animations for dead units.
if (isEffectivelyDead())
Comment thread
xezon marked this conversation as resolved.
return;
#endif

updateUpgradeModules();

const UpgradeTemplate* up = TheUpgradeCenter->findVeterancyUpgrade(newLevel);
Expand Down Expand Up @@ -2843,7 +2849,18 @@ void Object::onVeterancyLevelChanged( VeterancyLevel oldLevel, VeterancyLevel ne
&& outerDrawable
&& outerDrawable->isVisible();

if( doAnimation && TheGameLogic->getDrawIconUI() )
if (doAnimation)
createVeterancyLevelFX(oldLevel, newLevel);
}

void Object::createVeterancyLevelFX(VeterancyLevel oldLevel, VeterancyLevel newLevel)
{
#if RETAIL_COMPATIBLE_CRC
if (isEffectivelyDead())
return;
#endif
Comment thread
xezon marked this conversation as resolved.

if (TheGameLogic->getDrawIconUI())
{
if( TheAnim2DCollection && TheGlobalData->m_levelGainAnimationName.isEmpty() == FALSE )
{
Expand All @@ -2863,7 +2880,6 @@ void Object::onVeterancyLevelChanged( VeterancyLevel oldLevel, VeterancyLevel ne
soundToPlay.setObjectID( getID() );
TheAudio->addAudioEvent( &soundToPlay );
}

}

//-------------------------------------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions GeneralsMD/Code/GameEngine/Include/GameLogic/Object.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ class Object : public Thing, public Snapshot

void scoreTheKill( const Object *victim ); ///< I just killed this object.
void onVeterancyLevelChanged( VeterancyLevel oldLevel, VeterancyLevel newLevel, Bool provideFeedback = TRUE ); ///< I just achieved this level right this moment
void createVeterancyLevelFX(VeterancyLevel oldLevel, VeterancyLevel newLevel);
ExperienceTracker* getExperienceTracker() {return m_experienceTracker;}
const ExperienceTracker* getExperienceTracker() const {return m_experienceTracker;}
VeterancyLevel getVeterancyLevel() const;
Expand Down
20 changes: 18 additions & 2 deletions GeneralsMD/Code/GameEngine/Source/GameLogic/Object/Object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3104,6 +3104,12 @@ Bool Object::hasAnySpecialPower() const
//-------------------------------------------------------------------------------------------------
void Object::onVeterancyLevelChanged( VeterancyLevel oldLevel, VeterancyLevel newLevel, Bool provideFeedback )
{
#if !RETAIL_COMPATIBLE_CRC
// TheSuperHackers @bugfix Stubbjax 10/12/2025 Do not apply veterancy bonuses and animations for dead units.
if (isEffectivelyDead())
return;
#endif

updateUpgradeModules();

const UpgradeTemplate* up = TheUpgradeCenter->findVeterancyUpgrade(newLevel);
Expand Down Expand Up @@ -3158,7 +3164,18 @@ void Object::onVeterancyLevelChanged( VeterancyLevel oldLevel, VeterancyLevel ne
&& outerDrawable
&& outerDrawable->isVisible();

if( doAnimation && TheGameLogic->getDrawIconUI() )
if (doAnimation)
createVeterancyLevelFX(oldLevel, newLevel);
}

void Object::createVeterancyLevelFX(VeterancyLevel oldLevel, VeterancyLevel newLevel)
{
#if RETAIL_COMPATIBLE_CRC
Comment thread
Caball009 marked this conversation as resolved.
if (isEffectivelyDead())
return;
#endif

if (TheGameLogic->getDrawIconUI())
{
if( TheAnim2DCollection && TheGlobalData->m_levelGainAnimationName.isEmpty() == FALSE )
{
Expand All @@ -3178,7 +3195,6 @@ void Object::onVeterancyLevelChanged( VeterancyLevel oldLevel, VeterancyLevel ne
soundToPlay.setObjectID( getID() );
TheAudio->addAudioEvent( &soundToPlay );
}

}

//-------------------------------------------------------------------------------------------------
Expand Down
Loading