Skip to content

Commit ff63f75

Browse files
authored
[GEN][ZH] Revert to uninitialized variable in AiPathFind::findGroundPath for VC6 builds to avoid mismatch with retail builds (#904)
1 parent c9d1fd5 commit ff63f75

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6649,7 +6649,13 @@ Path *Pathfinder::findGroundPath( const Coord3D *from,
66496649
const Int adjacent[5] = {0, 1, 2, 3, 0};
66506650
Bool neighborFlags[8] = {false, false, false, false, false, false, false};
66516651

6652+
// TheSuperHackers @fix Mauller 23/05/2025 Fixes uninitialized variable.
6653+
// To keep retail compatibility it needs to be uninitialized in VC6 builds.
6654+
#if defined(_MSC_VER) && _MSC_VER < 1300
6655+
UnsignedInt newCostSoFar;
6656+
#else
66526657
UnsignedInt newCostSoFar = 0;
6658+
#endif
66536659

66546660
for( int i=0; i<numNeighbors; i++ )
66556661
{

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7193,7 +7193,13 @@ Path *Pathfinder::findGroundPath( const Coord3D *from,
71937193
const Int adjacent[5] = {0, 1, 2, 3, 0};
71947194
Bool neighborFlags[8] = {false, false, false, false, false, false, false};
71957195

7196+
// TheSuperHackers @fix Mauller 23/05/2025 Fixes uninitialized variable.
7197+
// To keep retail compatibility it needs to be uninitialized in VC6 builds.
7198+
#if defined(_MSC_VER) && _MSC_VER < 1300
7199+
UnsignedInt newCostSoFar;
7200+
#else
71967201
UnsignedInt newCostSoFar = 0;
7202+
#endif
71977203

71987204
for( int i=0; i<numNeighbors; i++ )
71997205
{

0 commit comments

Comments
 (0)