diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-06-26 00:41:35 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-06-26 00:41:35 +0300 |
commit | 5344dc6cd9156a9b67da834c9b5b4be00a62992a (patch) | |
tree | e71a20fbc231ccec6e53a718758eea447cfc7069 /src/navigationmanager.cpp | |
parent | 02822f84a25b261f02f5928a6cbefe103cd9491e (diff) | |
download | manaplus-5344dc6cd9156a9b67da834c9b5b4be00a62992a.tar.gz manaplus-5344dc6cd9156a9b67da834c9b5b4be00a62992a.tar.bz2 manaplus-5344dc6cd9156a9b67da834c9b5b4be00a62992a.tar.xz manaplus-5344dc6cd9156a9b67da834c9b5b4be00a62992a.zip |
Add missing checks into other files.
Diffstat (limited to 'src/navigationmanager.cpp')
-rw-r--r-- | src/navigationmanager.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/navigationmanager.cpp b/src/navigationmanager.cpp index 5df18013f..cf078e06f 100644 --- a/src/navigationmanager.cpp +++ b/src/navigationmanager.cpp @@ -66,6 +66,8 @@ Resource *NavigationManager::loadWalkLayer(const Map *const map) const MetaTile *const tiles = map->getMetaTiles(); int *const data = walkLayer->getData(); + if (!tiles || !data) + return walkLayer; int x = 0; int y = 0; @@ -81,7 +83,8 @@ Resource *NavigationManager::loadWalkLayer(const Map *const map) #endif bool NavigationManager::findWalkableTile(int &x1, int &y1, - const int width, const int height, + const int width, + const int height, const MetaTile *const tiles, const int *const data) { @@ -103,8 +106,10 @@ bool NavigationManager::findWalkableTile(int &x1, int &y1, } void NavigationManager::fillNum(int x, int y, - const int width, const int height, - const int num, const MetaTile *const tiles, + const int width, + const int height, + const int num, + const MetaTile *const tiles, int *const data) { std::vector<Cell> cells; |