From 59f67ec52e74ee24e5898acd3a6bc17c3d1d36e5 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 24 Jan 2012 00:24:21 +0300 Subject: Move one line in findpath map method. --- src/map.cpp | 6 +++--- 1 file 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 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 openList; + // Add the start point to the open list openList.push(Location(startX, startY, startTile)); -- cgit v1.2.3-70-g09d2