summaryrefslogtreecommitdiff
path: root/tools/tmxcopy/map.cpp
diff options
context:
space:
mode:
authorSteve Cotton <steve@s.cotton.clara.co.uk>2009-03-08 00:34:12 +0000
committerSteve Cotton <steve@s.cotton.clara.co.uk>2009-03-09 22:55:32 +0000
commitde6302f27a5454bdc8fca2fcc2e958916826450f (patch)
tree91dcdc3080bdca5bde503dd9d8ea61a2c3a0c89f /tools/tmxcopy/map.cpp
parentc62de9aa47285c1145c5e24dae5638bfc47bbf52 (diff)
downloadmana-client-de6302f27a5454bdc8fca2fcc2e958916826450f.tar.gz
mana-client-de6302f27a5454bdc8fca2fcc2e958916826450f.tar.bz2
mana-client-de6302f27a5454bdc8fca2fcc2e958916826450f.tar.xz
mana-client-de6302f27a5454bdc8fca2fcc2e958916826450f.zip
Fix tmxcopy off-by-one error translating tilesets
The first tiles of each tileset got shuffled.
Diffstat (limited to 'tools/tmxcopy/map.cpp')
-rw-r--r--tools/tmxcopy/map.cpp6
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;