Skip to content

Commit 092a2d2

Browse files
Maullerxezon
authored andcommitted
[GEN][ZH] Fix uninitialized supplyTruck variable in AiPlayer::onUnitProduced() (#653)
1 parent a3ae61d commit 092a2d2

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

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

+6
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,13 @@ Bool AIPlayer::isLocationSafe(const Coord3D *pos, const ThingTemplate *tthing )
10411041
void AIPlayer::onUnitProduced( Object *factory, Object *unit )
10421042
{
10431043
Bool found = false;
1044+
// TheSuperHackers @fix Mauller 26/04/2025 Fixes uninitialized variable.
1045+
// To keep retail compatibility this needs to remain uninitialized in VS6 builds.
1046+
#if defined(_MSC_VER) && _MSC_VER < 1300
10441047
Bool supplyTruck;
1048+
#else
1049+
Bool supplyTruck = false;
1050+
#endif
10451051

10461052
// factory could be NULL at the start of the game.
10471053
if (factory == NULL) {

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

+6
Original file line numberDiff line numberDiff line change
@@ -1048,7 +1048,13 @@ Bool AIPlayer::isLocationSafe(const Coord3D *pos, const ThingTemplate *tthing )
10481048
void AIPlayer::onUnitProduced( Object *factory, Object *unit )
10491049
{
10501050
Bool found = false;
1051+
// TheSuperHackers @fix Mauller 26/04/2025 Fixes uninitialized variable.
1052+
// To keep retail compatibility this needs to remain uninitialized in VS6 builds.
1053+
#if defined(_MSC_VER) && _MSC_VER < 1300
10511054
Bool supplyTruck;
1055+
#else
1056+
Bool supplyTruck = false;
1057+
#endif
10521058

10531059
// factory could be NULL at the start of the game.
10541060
if (factory == NULL) {

0 commit comments

Comments
 (0)