diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-07-11 00:12:28 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-07-11 00:12:28 +0300 |
commit | ee75580d40c5c444d184a6ecbeb99493ba42085a (patch) | |
tree | 2db8ff3378810b33c8713d8e4eda1511c36ccb06 /src/resources/mapreader.cpp | |
parent | 4fbb944f132eb886a6f5b350e5a14a4fe380aacf (diff) | |
download | manaverse-ee75580d40c5c444d184a6ecbeb99493ba42085a.tar.gz manaverse-ee75580d40c5c444d184a6ecbeb99493ba42085a.tar.bz2 manaverse-ee75580d40c5c444d184a6ecbeb99493ba42085a.tar.xz manaverse-ee75580d40c5c444d184a6ecbeb99493ba42085a.zip |
Add missing checks into resources.
Diffstat (limited to 'src/resources/mapreader.cpp')
-rw-r--r-- | src/resources/mapreader.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
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<uint8_t>( gid - set->getFirstGid() + 1)); |