Skip to content

Commit 042fc81

Browse files
authored
bugfix(energy): Destruction of disabled Power Plant no longer lowers energy production twice (#1857)
1 parent e104d68 commit 042fc81

File tree

2 files changed

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

2 files changed

+12
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,12 @@ void Energy::removePowerBonus( Object *obj )
188188
if( obj == NULL )
189189
return;
190190

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

193199
// sanity

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,12 @@ void Energy::removePowerBonus( Object *obj )
207207
if( obj == NULL )
208208
return;
209209

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

212218
// sanity

0 commit comments

Comments
 (0)