diff options
-rw-r--r-- | src/gui/socialwindow.cpp | 2 | ||||
-rw-r--r-- | src/map.cpp | 3 | ||||
-rw-r--r-- | src/map.h | 3 |
3 files changed, 7 insertions, 1 deletions
diff --git a/src/gui/socialwindow.cpp b/src/gui/socialwindow.cpp index 2d8ecc54f..b2c28e84e 100644 --- a/src/gui/socialwindow.cpp +++ b/src/gui/socialwindow.cpp @@ -650,7 +650,7 @@ public: return; Map* map = socialWindow->getMap(); - if (!map) + if (!map || map->empty()) return; if (socialWindow->getProcessedPortals()) 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 @@ -498,6 +498,9 @@ class Map : public Properties, public ConfigListener void redrawMap(); + bool empty() + { return mLayers.empty(); } + protected: friend class Actor; friend class Minimap; |