diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-08-18 18:51:15 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-08-18 18:51:15 +0300 |
commit | e469ab2f1940cb04b53bb3b72cc7b5a0cd0669b0 (patch) | |
tree | bfeb4a907acd9e0b6838e393eccf3bf6da44ccad /src/resources | |
parent | c8b1e6e5455dd0c9c51b6b212478ed1e5aa1af4c (diff) | |
download | mv-e469ab2f1940cb04b53bb3b72cc7b5a0cd0669b0.tar.gz mv-e469ab2f1940cb04b53bb3b72cc7b5a0cd0669b0.tar.bz2 mv-e469ab2f1940cb04b53bb3b72cc7b5a0cd0669b0.tar.xz mv-e469ab2f1940cb04b53bb3b72cc7b5a0cd0669b0.zip |
Add some clang fixes.
Diffstat (limited to 'src/resources')
-rw-r--r-- | src/resources/db/mapdb.cpp | 4 | ||||
-rw-r--r-- | src/resources/mapreader.cpp | 7 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/resources/db/mapdb.cpp b/src/resources/db/mapdb.cpp index 48d234bb4..fde608496 100644 --- a/src/resources/db/mapdb.cpp +++ b/src/resources/db/mapdb.cpp @@ -213,11 +213,11 @@ const MapInfo *MapDB::getMapAtlas(const std::string &name) const MapInfo *MapDB::getAtlas(const std::string &name) { - MapInfo *const info = new MapInfo; - const AtlasCIter it = mAtlases.find(name); if (it == mAtlases.end()) return nullptr; + + MapInfo *const info = new MapInfo; info->atlas = name; info->files = &(*it).second; return info; diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp index 0b06fb455..5c6282135 100644 --- a/src/resources/mapreader.cpp +++ b/src/resources/mapreader.cpp @@ -1199,7 +1199,12 @@ Tileset *MapReader::readTileset(XmlNodePtr node, const int duration = XML::getProperty( frameNode, "duration", 0) / 10; - ani->addFrame(set->get(tileId), duration, 0, 0, 100); + if (set) + { + ani->addFrame(set->get(tileId), + duration, + 0, 0, 100); + } } } |