Skip to content

Commit 41f2e5c

Browse files
committed
bugfix: Preserve scaffold health when AI building construction completes (#1343)
1 parent 24f8da9 commit 41f2e5c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ 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-
d.setInt(TheKey_objectInitialHealth, info->getHealth());
124+
// TheSuperHackers @bugfix bobtista 31/10/2025 Preserve scaffold health when AI building construction completes instead of resetting to initial health. (#1343)
125125
d.setBool(TheKey_objectUnsellable, info->getUnsellable());
126126

127127
info->setUnderConstruction(false);
@@ -458,7 +458,7 @@ Object *AIPlayer::buildStructureNow(const ThingTemplate *bldgPlan, BuildListInfo
458458
Dict d;
459459
d.setAsciiString(TheKey_objectName, info->getBuildingName());
460460
d.setAsciiString(TheKey_objectScriptAttachment, info->getScript());
461-
d.setInt(TheKey_objectInitialHealth, info->getHealth());
461+
// TheSuperHackers @bugfix bobtista 31/10/2025 Preserve scaffold health when AI building construction completes instead of resetting to initial health. (#1343)
462462
d.setBool(TheKey_objectUnsellable, info->getUnsellable());
463463

464464
bldg->updateObjValuesFromMapProperties(&d);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ 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-
d.setInt(TheKey_objectInitialHealth, info->getHealth());
125+
// TheSuperHackers @bugfix bobtista 31/10/2025 Preserve scaffold health when AI building construction completes instead of resetting to initial health. (#1343)
126126
d.setBool(TheKey_objectUnsellable, info->getUnsellable());
127127

128128
info->setUnderConstruction(false);
@@ -462,7 +462,7 @@ Object *AIPlayer::buildStructureNow(const ThingTemplate *bldgPlan, BuildListInfo
462462
Dict d;
463463
d.setAsciiString(TheKey_objectName, info->getBuildingName());
464464
d.setAsciiString(TheKey_objectScriptAttachment, info->getScript());
465-
d.setInt(TheKey_objectInitialHealth, info->getHealth());
465+
// TheSuperHackers @bugfix bobtista 31/10/2025 Preserve scaffold health when AI building construction completes instead of resetting to initial health. (#1343)
466466
d.setBool(TheKey_objectUnsellable, info->getUnsellable());
467467

468468
bldg->updateObjValuesFromMapProperties(&d);

0 commit comments

Comments
 (0)