From 2039c6b5f2e19bf74f060389d95f20d640113c25 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 28 Feb 2016 01:45:54 +0300 Subject: hercules: show error message in tmx to mapcache converter if collision layer missing. --- hercules/code/clienttoserver/maps.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'hercules') 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) -- cgit v1.2.3-70-g09d2