Skip to content

Commit 89c7698

Browse files
committed
Simplified non-retail logic.
1 parent 6c3b0d4 commit 89c7698

File tree

2 files changed

+10
-10
lines changed
  • GeneralsMD/Code/GameEngine/Source/Common/RTS
  • Generals/Code/GameEngine/Source/Common/RTS

2 files changed

+10
-10
lines changed

Generals/Code/GameEngine/Source/Common/RTS/Energy.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,13 +189,13 @@ void Energy::removePowerBonus( Object *obj )
189189
return;
190190

191191
// TheSuperHackers @bugfix Caball009 14/11/2025 Don't remove power bonus for disabled power plants.
192-
#if RETAIL_COMPATIBLE_CRC
193-
addProduction( -obj->getTemplate()->getEnergyBonus() );
194-
#else
195-
if ( !obj->isDisabled() )
196-
addProduction( -obj->getTemplate()->getEnergyBonus() );
192+
#if !RETAIL_COMPATIBLE_CRC
193+
if ( obj->isDisabled() )
194+
return;
197195
#endif
198196

197+
addProduction( -obj->getTemplate()->getEnergyBonus() );
198+
199199
// sanity
200200
DEBUG_ASSERTCRASH( m_energyProduction >= 0 && m_energyConsumption >= 0,
201201
("Energy - Negative Energy numbers, Produce=%d Consume=%d\n",

GeneralsMD/Code/GameEngine/Source/Common/RTS/Energy.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -208,13 +208,13 @@ void Energy::removePowerBonus( Object *obj )
208208
return;
209209

210210
// TheSuperHackers @bugfix Caball009 14/11/2025 Don't remove power bonus for disabled power plants.
211-
#if RETAIL_COMPATIBLE_CRC
212-
addProduction( -obj->getTemplate()->getEnergyBonus() );
213-
#else
214-
if ( !obj->isDisabled() )
215-
addProduction( -obj->getTemplate()->getEnergyBonus() );
211+
#if !RETAIL_COMPATIBLE_CRC
212+
if ( obj->isDisabled() )
213+
return;
216214
#endif
217215

216+
addProduction( -obj->getTemplate()->getEnergyBonus() );
217+
218218
// sanity
219219
DEBUG_ASSERTCRASH( m_energyProduction >= 0 && m_energyConsumption >= 0,
220220
("Energy - Negative Energy numbers, Produce=%d Consume=%d\n",

0 commit comments

Comments
 (0)