summaryrefslogtreecommitdiff
path: root/src/resources/mapreader.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-07-11 00:12:28 +0300
committerAndrei Karas <akaras@inbox.ru>2015-07-11 00:12:28 +0300
commitee75580d40c5c444d184a6ecbeb99493ba42085a (patch)
tree2db8ff3378810b33c8713d8e4eda1511c36ccb06 /src/resources/mapreader.cpp
parent4fbb944f132eb886a6f5b350e5a14a4fe380aacf (diff)
downloadmv-ee75580d40c5c444d184a6ecbeb99493ba42085a.tar.gz
mv-ee75580d40c5c444d184a6ecbeb99493ba42085a.tar.bz2
mv-ee75580d40c5c444d184a6ecbeb99493ba42085a.tar.xz
mv-ee75580d40c5c444d184a6ecbeb99493ba42085a.zip
Add missing checks into resources.
Diffstat (limited to 'src/resources/mapreader.cpp')
-rw-r--r--src/resources/mapreader.cpp6
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));