File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed
GeneralsMD/Code/GameEngine/Source/Common/RTS
Generals/Code/GameEngine/Source/Common/RTS Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff 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 " ,
Original file line number Diff line number Diff 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 " ,
You can’t perform that action at this time.
0 commit comments