From e1975c832fe31c7748589fb9399d3644074fa4e1 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 4 Jul 2016 21:25:53 +0300 Subject: hercules: in map extract script, extract also maps into text format. --- hercules/code/server/maps.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'hercules') 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])) -- cgit v1.2.3-60-g2f50