summaryrefslogtreecommitdiff
path: root/src/map.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/map.cpp')
-rw-r--r--src/map.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/map.cpp b/src/map.cpp
index 63b815af2..211504504 100644
--- a/src/map.cpp
+++ b/src/map.cpp
@@ -1392,6 +1392,9 @@ Path Map::findPath(int startX, int startY, int destX, int destY,
// Reset starting tile's G cost to 0
MetaTile *startTile = &mMetaTiles[startX + startY * mWidth];
+ if (!startTile)
+ return path;
+
startTile->Gcost = 0;
// Add the start point to the open list