Skip to content

Commit 3feb3fc

Browse files
Maullerxezon
authored andcommitted
[GEN][ZH] Fix uninitialized costSoFar variable in AIPathfind::findGoundPath() (#632)
1 parent 8b7b047 commit 3feb3fc

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -6649,7 +6649,7 @@ 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-
UnsignedInt newCostSoFar;
6652+
UnsignedInt newCostSoFar = 0;
66536653

66546654
for( int i=0; i<numNeighbors; i++ )
66556655
{

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -7192,7 +7192,7 @@ Path *Pathfinder::findGroundPath( const Coord3D *from,
71927192
const Int adjacent[5] = {0, 1, 2, 3, 0};
71937193
Bool neighborFlags[8] = {false, false, false, false, false, false, false};
71947194

7195-
UnsignedInt newCostSoFar;
7195+
UnsignedInt newCostSoFar = 0;
71967196

71977197
for( int i=0; i<numNeighbors; i++ )
71987198
{

0 commit comments

Comments
 (0)