From 5344dc6cd9156a9b67da834c9b5b4be00a62992a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 26 Jun 2015 00:41:35 +0300 Subject: Add missing checks into other files. --- src/navigationmanager.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/navigationmanager.cpp') 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 cells; -- cgit v1.2.3-60-g2f50