diff options
-rw-r--r-- | src/map.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/map.cpp b/src/map.cpp index 211504504..2209cf997 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -1383,9 +1383,6 @@ Path Map::findPath(int startX, int startY, int destX, int destY, if (startX >= mWidth || startY >= mHeight) return path; - // Declare open list, a list with open tiles sorted on F cost - std::priority_queue<Location> openList; - // Return when destination not walkable if (!getWalk(destX, destY, walkmask)) return path; @@ -1397,6 +1394,9 @@ Path Map::findPath(int startX, int startY, int destX, int destY, startTile->Gcost = 0; + // Declare open list, a list with open tiles sorted on F cost + std::priority_queue<Location> openList; + // Add the start point to the open list openList.push(Location(startX, startY, startTile)); |