summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-06-26 13:02:09 +0300
committerAndrei Karas <akaras@inbox.ru>2015-06-26 13:02:09 +0300
commit2c190ef2bdd8bbfb9af39d2e2a5219242762ee23 (patch)
treeb2ef045f9bdb4b8f8fc0371bb9e3679f34f708ed
parent5344dc6cd9156a9b67da834c9b5b4be00a62992a (diff)
downloadmv-2c190ef2bdd8bbfb9af39d2e2a5219242762ee23.tar.gz
mv-2c190ef2bdd8bbfb9af39d2e2a5219242762ee23.tar.bz2
mv-2c190ef2bdd8bbfb9af39d2e2a5219242762ee23.tar.xz
mv-2c190ef2bdd8bbfb9af39d2e2a5219242762ee23.zip
Fix map layers loading after last checks.
-rw-r--r--src/resources/mapreader.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp
index 414a19d24..d376ddbb4 100644
--- a/src/resources/mapreader.cpp
+++ b/src/resources/mapreader.cpp
@@ -496,7 +496,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, 2, 4);
+ const int gid) A_NONNULL(1, 4);
inline static void setTile(Map *const map,
MapLayer *const layer,
@@ -512,7 +512,8 @@ inline static void setTile(Map *const map,
{
Image *const img = set ? set->get(gid - set->getFirstGid())
: nullptr;
- layer->setTile(x, y, img);
+ if (layer)
+ layer->setTile(x, y, img);
break;
}
@@ -597,7 +598,7 @@ bool MapReader::readBase64Layer(const XmlNodePtrConst childNode,
int &restrict x, int &restrict y,
const int w, const int h)
{
- if (!map || !layer || !childNode)
+ if (!map || !childNode)
return false;
if (!compression.empty() && compression != "gzip"
@@ -702,7 +703,7 @@ bool MapReader::readCsvLayer(const XmlNodePtrConst childNode,
int &restrict x, int &restrict y,
const int w, const int h)
{
- if (!map || !layer || !childNode)
+ if (!map || !childNode)
return false;
XmlNodePtrConst dataChild = childNode->xmlChildrenNode;