diff --git a/Generals/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp b/Generals/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp index e18c3c420ce..2e55539592c 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp @@ -6649,7 +6649,7 @@ Path *Pathfinder::findGroundPath( const Coord3D *from, const Int adjacent[5] = {0, 1, 2, 3, 0}; Bool neighborFlags[8] = {false, false, false, false, false, false, false}; - UnsignedInt newCostSoFar; + UnsignedInt newCostSoFar = 0; for( int i=0; ix + 0.5f)/PATHFIND_CELL_SIZE_F); cellBounds.lo.y = REAL_TO_INT_FLOOR((pos->y + 0.5f)/PATHFIND_CELL_SIZE_F); + cellBounds.hi.x = REAL_TO_INT_CEIL((pos->x + 0.5f)/PATHFIND_CELL_SIZE_F); + cellBounds.hi.y = REAL_TO_INT_CEIL((pos->y + 0.5f)/PATHFIND_CELL_SIZE_F); Bool didAnything = false; for (Int iy = 0; iy < numStepsY; ++iy, tl_x += ydx, tl_y += ydy) @@ -7190,7 +7192,7 @@ Path *Pathfinder::findGroundPath( const Coord3D *from, const Int adjacent[5] = {0, 1, 2, 3, 0}; Bool neighborFlags[8] = {false, false, false, false, false, false, false}; - UnsignedInt newCostSoFar; + UnsignedInt newCostSoFar = 0; for( int i=0; i