diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/map.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/map.cpp b/src/map.cpp index efd108185..aa28a8160 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -1377,12 +1377,15 @@ void Map::indexTilesets() mTilesetsIndexed = true; const Tileset *s = nullptr; + size_t sSz = 0; FOR_EACH (Tilesets::const_iterator, it, mTilesets) { - if (!s || s->getFirstGid() + s->size() - < (*it)->getFirstGid() + (*it)->size()) + const size_t sz = (*it)->size(); + if (!s || s->getFirstGid() + sSz + < (*it)->getFirstGid() + sz) { s = *it; + sSz = sz; } } if (!s) |