diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-01-13 22:24:59 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-01-13 23:15:55 +0300 |
commit | bf1a006a34ba30143c00be899332acedef29575b (patch) | |
tree | 996b3d75d1dd4903b3377d2f9e822b6937d45511 /src/map.cpp | |
parent | d9c0a036a5d480c615d866bf98893906b1e7efab (diff) | |
download | ManaVerse-bf1a006a34ba30143c00be899332acedef29575b.tar.gz ManaVerse-bf1a006a34ba30143c00be899332acedef29575b.tar.bz2 ManaVerse-bf1a006a34ba30143c00be899332acedef29575b.tar.xz ManaVerse-bf1a006a34ba30143c00be899332acedef29575b.zip |
Fix possible incorrect memory access.
Diffstat (limited to 'src/map.cpp')
-rw-r--r-- | src/map.cpp | 3 |
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 |