summaryrefslogtreecommitdiff
path: root/hercules
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
parentcb2400acce4696533dcb007b56b8531465c94b8b (diff)
downloadevol-tools-2039c6b5f2e19bf74f060389d95f20d640113c25.tar.gz
evol-tools-2039c6b5f2e19bf74f060389d95f20d640113c25.tar.bz2
evol-tools-2039c6b5f2e19bf74f060389d95f20d640113c25.tar.xz
evol-tools-2039c6b5f2e19bf74f060389d95f20d640113c25.zip
hercules: show error message in tmx to mapcache converter if collision layer missing.
Diffstat (limited to 'hercules')
-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)