summaryrefslogtreecommitdiff
path: root/src/being.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/being.cpp')
-rw-r--r--src/being.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/being.cpp b/src/being.cpp
index 80de74e1..7ed73b8f 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -203,7 +203,13 @@ void Being::setDestination(int destX, int destY)
{
this->destX = destX;
this->destY = destY;
- setPath(tiledMap->findPath(x, y, destX, destY));
+
+ Map *map = engine->getCurrentMap();
+
+ if (map != NULL)
+ {
+ setPath(map->findPath(x, y, destX, destY));
+ }
}
void Being::setHairColor(int color)