From 3ec3f93e76cf42b8d37d2d6ece6466ccc3fdb424 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 2 Jul 2016 17:07:01 +0300 Subject: hercules: tmx to map cache converter now should works with collision layer name in any case. --- hercules/code/clienttoserver/maps.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'hercules') diff --git a/hercules/code/clienttoserver/maps.py b/hercules/code/clienttoserver/maps.py index aba9ff6..7db8b92 100644 --- a/hercules/code/clienttoserver/maps.py +++ b/hercules/code/clienttoserver/maps.py @@ -28,6 +28,7 @@ def recreateMapCache(): makeDir(destDir) sz = 0L mapsCount = 0 + collisionLayerName = "collision" with open(destDir + "map_cache.dat", "wb") as w: writeInt32(w, 0) # file size writeInt16(w, 0) # maps count @@ -42,13 +43,13 @@ def recreateMapCache(): name = tileset.attributes["name"].value except: name = "" - if name.lower() == "collision": + if name.lower() == collisionLayerName: firstgid = int(tileset.attributes["firstgid"].value) break found = False for layer in root.getElementsByTagName("layer"): - if layer.attributes["name"].value == "Collision": + if layer.attributes["name"].value.lower() == collisionLayerName: data = layer.getElementsByTagName("data") if data is None or len(data) != 1: continue -- cgit v1.2.3-70-g09d2