diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-07-02 17:07:01 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-07-02 17:08:48 +0300 |
commit | 3ec3f93e76cf42b8d37d2d6ece6466ccc3fdb424 (patch) | |
tree | 74bd46c19802d175061f35e5fcaab2ecef01953d /hercules/code | |
parent | 070707ab15b7b9fb13837c3e36e60dfdb1037067 (diff) | |
download | evol-tools-3ec3f93e76cf42b8d37d2d6ece6466ccc3fdb424.tar.gz evol-tools-3ec3f93e76cf42b8d37d2d6ece6466ccc3fdb424.tar.bz2 evol-tools-3ec3f93e76cf42b8d37d2d6ece6466ccc3fdb424.tar.xz evol-tools-3ec3f93e76cf42b8d37d2d6ece6466ccc3fdb424.zip |
hercules: tmx to map cache converter now should works with collision layer name in any case.
Diffstat (limited to 'hercules/code')
-rw-r--r-- | hercules/code/clienttoserver/maps.py | 5 |
1 files changed, 3 insertions, 2 deletions
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 |