Skip to content

Commit a1d2347

Browse files
authored
[GEN][ZH] No longer adjust the power level for disabled Power Plants that are still under construction (#1302)
1 parent 3f85acb commit a1d2347

File tree

2 files changed

+12
-2
lines changed
  • GeneralsMD/Code/GameEngine/Source/GameLogic/Object
  • Generals/Code/GameEngine/Source/GameLogic/Object

2 files changed

+12
-2
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3321,7 +3321,12 @@ void Object::onDisabledEdge(Bool becomingDisabled)
33213321
// We will need to adjust power ... somehow ...
33223322
Int powerToAdjust = getTemplate()->getEnergyProduction();
33233323

3324-
if( powerToAdjust > 0 )
3324+
// TheSuperHackers @bugfix Caball009 18/07/2025 Don't adjust the power for power plants that are still under construction.
3325+
#if !RETAIL_COMPATIBLE_CRC
3326+
if ( powerToAdjust > 0 && !testStatus(OBJECT_STATUS_UNDER_CONSTRUCTION) )
3327+
#else
3328+
if ( powerToAdjust > 0 )
3329+
#endif
33253330
{
33263331
// We can't affect something that consumes, or else we go low power which removes the consumption
33273332
// which makes us not low power so we add the consumption so we go low power...

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3841,7 +3841,12 @@ void Object::onDisabledEdge(Bool becomingDisabled)
38413841
// We will need to adjust power ... somehow ...
38423842
Int powerToAdjust = getTemplate()->getEnergyProduction();
38433843

3844-
if( powerToAdjust > 0 )
3844+
// TheSuperHackers @bugfix Caball009 18/07/2025 Don't adjust the power for power plants that are still under construction.
3845+
#if !RETAIL_COMPATIBLE_CRC
3846+
if ( powerToAdjust > 0 && !testStatus(OBJECT_STATUS_UNDER_CONSTRUCTION) )
3847+
#else
3848+
if ( powerToAdjust > 0 )
3849+
#endif
38453850
{
38463851
// We can't affect something that consumes, or else we go low power which removes the consumption
38473852
// which makes us not low power so we add the consumption so we go low power...

0 commit comments

Comments
 (0)