summaryrefslogtreecommitdiff
path: root/hercules/code/clienttoserver/maps.py
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-28 01:45:54 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-28 01:45:54 +0300
commit2039c6b5f2e19bf74f060389d95f20d640113c25 (patch)
treecfdd742dd51b40a5dd3f328b2db4ede83c18f07a /hercules/code/clienttoserver/maps.py
parentcb2400acce4696533dcb007b56b8531465c94b8b (diff)
downloadtools-2039c6b5f2e19bf74f060389d95f20d640113c25.tar.gz
tools-2039c6b5f2e19bf74f060389d95f20d640113c25.tar.bz2
tools-2039c6b5f2e19bf74f060389d95f20d640113c25.tar.xz
tools-2039c6b5f2e19bf74f060389d95f20d640113c25.zip
hercules: show error message in tmx to mapcache converter if collision layer missing.
Diffstat (limited to 'hercules/code/clienttoserver/maps.py')
-rw-r--r--hercules/code/clienttoserver/maps.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/hercules/code/clienttoserver/maps.py b/hercules/code/clienttoserver/maps.py
index 6742456..b138642 100644
--- a/hercules/code/clienttoserver/maps.py
+++ b/hercules/code/clienttoserver/maps.py
@@ -46,6 +46,7 @@ def recreateMapCache():
firstgid = int(tileset.attributes["firstgid"].value)
break
+ found = False
for layer in root.getElementsByTagName("layer"):
if layer.attributes["name"].value == "Collision":
data = layer.getElementsByTagName("data")
@@ -132,7 +133,10 @@ def recreateMapCache():
print fileName
mapsCount = mapsCount + 1
sz = sz + 12 + 8 + len(binData)
+ found = True
break
+ if found == False:
+ print "Error: missing collision layer in file: {0}".format(fileName)
w.seek(0);
writeInt32(w, sz)
writeInt16(w, mapsCount)