From ee75580d40c5c444d184a6ecbeb99493ba42085a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 11 Jul 2015 00:12:28 +0300 Subject: Add missing checks into resources. --- src/resources/mapreader.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/resources/mapreader.cpp') diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp index 54ee95ea5..f2ec5633d 100644 --- a/src/resources/mapreader.cpp +++ b/src/resources/mapreader.cpp @@ -497,7 +497,7 @@ inline static void setTile(Map *const map, const MapLayer::Type &layerType, MapHeights *const heights, const int x, const int y, - const int gid) A_NONNULL(1, 4); + const int gid) A_NONNULL(1); inline static void setTile(Map *const map, MapLayer *const layer, @@ -556,9 +556,9 @@ inline static void setTile(Map *const map, case MapLayer::HEIGHTS: { - if (!set) + if (!set || !heights) break; - if (map->getVersion() >= 2) + if (heights && map->getVersion() >= 2) { heights->setHeight(x, y, static_cast( gid - set->getFirstGid() + 1)); -- cgit v1.2.3-70-g09d2