summaryrefslogtreecommitdiff
path: root/hercules
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-07-02 17:07:01 +0300
committerAndrei Karas <akaras@inbox.ru>2016-07-02 17:08:48 +0300
commit3ec3f93e76cf42b8d37d2d6ece6466ccc3fdb424 (patch)
tree74bd46c19802d175061f35e5fcaab2ecef01953d /hercules
parent070707ab15b7b9fb13837c3e36e60dfdb1037067 (diff)
downloadtools-3ec3f93e76cf42b8d37d2d6ece6466ccc3fdb424.tar.gz
tools-3ec3f93e76cf42b8d37d2d6ece6466ccc3fdb424.tar.bz2
tools-3ec3f93e76cf42b8d37d2d6ece6466ccc3fdb424.tar.xz
tools-3ec3f93e76cf42b8d37d2d6ece6466ccc3fdb424.zip
hercules: tmx to map cache converter now should works with collision layer name in any case.
Diffstat (limited to 'hercules')
-rw-r--r--hercules/code/clienttoserver/maps.py5
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