diff options
-rw-r--r-- | tools/tmxcopy/map.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/tmxcopy/map.cpp b/tools/tmxcopy/map.cpp index d9fc8ada..1c374e25 100644 --- a/tools/tmxcopy/map.cpp +++ b/tools/tmxcopy/map.cpp @@ -155,7 +155,7 @@ Map::Map(std::string filename): { for (int s = mTilesets.size()-1; s >= 0; s--) { - if (mTilesets.at(s)->firstgid < gid) + if (mTilesets.at(s)->firstgid <= gid) { layer->at(c).tileset = s; layer->at(c).index = gid - mTilesets.at(s)->firstgid; @@ -204,6 +204,10 @@ bool Map::overwrite( Map* srcMap, std::cerr<<"Error: Area exceeds lower map border of target map!"<<std::endl; checkPassed = false; } + if (srcMap->getNumberOfLayers() > mLayers.size()) { + std::cerr<<"Error: Source has more layers than target map"<<std::endl; + checkPassed = false; + } if (!checkPassed) return false; std::map<int, int> translation; |