diff --git a/Generals/Code/GameEngine/Include/GameLogic/AIPathfind.h b/Generals/Code/GameEngine/Include/GameLogic/AIPathfind.h index 4818f1aeec..8789b6cb1e 100644 --- a/Generals/Code/GameEngine/Include/GameLogic/AIPathfind.h +++ b/Generals/Code/GameEngine/Include/GameLogic/AIPathfind.h @@ -207,6 +207,7 @@ class PathfindCellInfo { friend class PathfindCell; public: + static void initializeCellInfos(void); static void allocateCellInfos(void); static void releaseCellInfos(void); diff --git a/Generals/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp b/Generals/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp index 26f4c8197d..bd3a060fbb 100644 --- a/Generals/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp +++ b/Generals/Code/GameEngine/Source/GameLogic/AI/AIPathfind.cpp @@ -1086,7 +1086,7 @@ Real Path::computeFlightDistToGoal( const Coord3D *pos, Coord3D& goalPos ) enum { PATHFIND_CELLS_PER_FRAME=5000}; // Number of cells we will search pathfinding per frame. enum {CELL_INFOS_TO_ALLOCATE = 30000}; PathfindCellInfo *PathfindCellInfo::s_infoArray = NULL; -PathfindCellInfo *PathfindCellInfo::s_firstFree = NULL; +PathfindCellInfo *PathfindCellInfo::s_firstFree = NULL; /** * Allocates a pool of pathfind cell infos. */ @@ -1094,13 +1094,7 @@ void PathfindCellInfo::allocateCellInfos(void) { releaseCellInfos(); s_infoArray = MSGNEW("PathfindCellInfo") PathfindCellInfo[CELL_INFOS_TO_ALLOCATE]; // pool[]ify - s_infoArray[CELL_INFOS_TO_ALLOCATE-1].m_pathParent = NULL; - s_infoArray[CELL_INFOS_TO_ALLOCATE-1].m_isFree = true; - s_firstFree = s_infoArray; - for (Int i=0; i