Skip to content

Commit ab9b554

Browse files
committed
bugfix: Preserve scaffold health when AI building construction completes
1 parent 24f8da9 commit ab9b554

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

Generals/Code/GameEngine/Source/GameLogic/AI/AIPlayer.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,10 @@ void AIPlayer::onStructureProduced( Object *factory, Object *bldg )
121121
Dict d;
122122
d.setAsciiString(TheKey_objectName, info->getBuildingName());
123123
d.setAsciiString(TheKey_objectScriptAttachment, info->getScript());
124+
// TheSuperHackers @bugfix bobtista 31/10/2025 Preserve scaffold health when AI building construction completes instead of resetting to initial health.
125+
#if RETAIL_COMPATIBLE_CRC || RETAIL_COMPATIBLE_BUG
124126
d.setInt(TheKey_objectInitialHealth, info->getHealth());
127+
#endif
125128
d.setBool(TheKey_objectUnsellable, info->getUnsellable());
126129

127130
info->setUnderConstruction(false);
@@ -458,7 +461,10 @@ Object *AIPlayer::buildStructureNow(const ThingTemplate *bldgPlan, BuildListInfo
458461
Dict d;
459462
d.setAsciiString(TheKey_objectName, info->getBuildingName());
460463
d.setAsciiString(TheKey_objectScriptAttachment, info->getScript());
464+
#if RETAIL_COMPATIBLE_CRC || RETAIL_COMPATIBLE_BUG
461465
d.setInt(TheKey_objectInitialHealth, info->getHealth());
466+
#endif
467+
// TheSuperHackers @bugfix bobtista 31/10/2025 Preserve scaffold health when AI building construction completes instead of resetting to initial health. (#1343)
462468
d.setBool(TheKey_objectUnsellable, info->getUnsellable());
463469

464470
bldg->updateObjValuesFromMapProperties(&d);

GeneralsMD/Code/GameEngine/Source/GameLogic/AI/AIPlayer.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,10 @@ void AIPlayer::onStructureProduced( Object *factory, Object *bldg )
122122
Dict d;
123123
d.setAsciiString(TheKey_objectName, info->getBuildingName());
124124
d.setAsciiString(TheKey_objectScriptAttachment, info->getScript());
125+
#if RETAIL_COMPATIBLE_CRC || RETAIL_COMPATIBLE_BUG
125126
d.setInt(TheKey_objectInitialHealth, info->getHealth());
127+
#endif
128+
// TheSuperHackers @bugfix bobtista 31/10/2025 Preserve scaffold health when AI building construction completes instead of resetting to initial health. (#1343)
126129
d.setBool(TheKey_objectUnsellable, info->getUnsellable());
127130

128131
info->setUnderConstruction(false);
@@ -462,7 +465,10 @@ Object *AIPlayer::buildStructureNow(const ThingTemplate *bldgPlan, BuildListInfo
462465
Dict d;
463466
d.setAsciiString(TheKey_objectName, info->getBuildingName());
464467
d.setAsciiString(TheKey_objectScriptAttachment, info->getScript());
468+
// TheSuperHackers @bugfix bobtista 31/10/2025 Preserve scaffold health when AI building construction completes instead of resetting to initial health.
469+
#if RETAIL_COMPATIBLE_CRC || RETAIL_COMPATIBLE_BUG
465470
d.setInt(TheKey_objectInitialHealth, info->getHealth());
471+
#endif
466472
d.setBool(TheKey_objectUnsellable, info->getUnsellable());
467473

468474
bldg->updateObjValuesFromMapProperties(&d);

0 commit comments

Comments
 (0)