summaryrefslogtreecommitdiff
path: root/hercules
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-07-04 21:25:53 +0300
committerAndrei Karas <akaras@inbox.ru>2016-07-04 21:25:53 +0300
commite1975c832fe31c7748589fb9399d3644074fa4e1 (patch)
tree7a2d13245644ba221d15235474a2fc26e2a3f8cf /hercules
parentd8554e469c9a0417750d65392e283c438fef7a12 (diff)
downloadtools-e1975c832fe31c7748589fb9399d3644074fa4e1.tar.gz
tools-e1975c832fe31c7748589fb9399d3644074fa4e1.tar.bz2
tools-e1975c832fe31c7748589fb9399d3644074fa4e1.tar.xz
tools-e1975c832fe31c7748589fb9399d3644074fa4e1.zip
hercules: in map extract script, extract also maps into text format.
Diffstat (limited to 'hercules')
-rw-r--r--hercules/code/server/maps.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/hercules/code/server/maps.py b/hercules/code/server/maps.py
index 2de4bfa..bdeb0f7 100644
--- a/hercules/code/server/maps.py
+++ b/hercules/code/server/maps.py
@@ -33,3 +33,9 @@ def extractMaps(f, mapsCount):
w.write(struct.pack("H", sx))
w.write(struct.pack("H", sy))
w.write(data)
+ with open(destDir + name + ".txt", "wb") as w:
+ arr = array.array("B")
+ arr.fromstring(data)
+ for x in xrange(0, sx):
+ for y in xrange(0, sy):
+ w.write("{0},{1}:{2}\n".format(x, y, arr[x + y * sx]))