diff options
Diffstat (limited to 'hercules/code/clienttoserver/maps.py')
-rw-r--r-- | hercules/code/clienttoserver/maps.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/hercules/code/clienttoserver/maps.py b/hercules/code/clienttoserver/maps.py index b9a1626..745bebe 100644 --- a/hercules/code/clienttoserver/maps.py +++ b/hercules/code/clienttoserver/maps.py @@ -54,21 +54,21 @@ def findFirstGid(tilesets, tile): # 6 - monster walk not allowed def convertTileType(tile, idx, width, height): if tile == 5: - tile = 0; + tile = 0 if tile > 6 or tile < 0: y = int(idx / width) x = idx - y * width - print "Error: wrong tile: ({0}, {1}) = {2}".format(x, y, tile) + print("Error: wrong tile: ({0}, {1}) = {2}".format(x, y, tile)) tile = 1 return tile # map file format # -# int16 version; -# uint8 md5_checksum[16]; -# int16 xs; -# int16 ys; -# int32 len; +# int16 version +# uint8 md5_checksum[16] +# int16 xs +# int16 ys +# int32 len # ...data... def recreateMap(names): @@ -77,7 +77,7 @@ def recreateMap(names): tmxName = names[0] mCaheName = destDir + names[1][:-3] + "mcache" with open(mCaheName, "wb") as w: - print tmxName + print(tmxName) dom = minidom.parse(tmxName) root = dom.documentElement tilesets = [] @@ -116,7 +116,7 @@ def recreateMap(names): tileType = 0 else: firstgid = findFirstGid(tilesets, tile) - tileType = convertTileType(tile - firstgid, idx, width, height); + tileType = convertTileType(tile - firstgid, idx, width, height) tiles.append(tileType) idx = idx + 1 elif encoding == "csv": @@ -132,7 +132,7 @@ def recreateMap(names): tileType = 0 else: firstgid = findFirstGid(tilesets, tile) - tileType = convertTileType(tile - firstgid, idx, width, height); + tileType = convertTileType(tile - firstgid, idx, width, height) # tmx collision format # 0 - walkable ground # 1 - non walkable wall @@ -156,7 +156,7 @@ def recreateMap(names): idx = idx + 1 f.close() else: - print "map format not supported: " + tmxName + print("map format not supported: " + tmxName) continue #comp = zlib.compressobj() @@ -172,7 +172,7 @@ def recreateMap(names): found = True break if found == False: - print "Error: missing collision layer in file: {0}".format(tmxName) + print("Error: missing collision layer in file: {0}".format(tmxName)) return return with open(mCaheName + ".debug", "wb") as w: |