From 1e5f884636e4f96ab39dd38866544f9cd9668d74 Mon Sep 17 00:00:00 2001 From: wushin Date: Sat, 14 Feb 2015 21:15:15 -0600 Subject: Make all warps unique --- tmx_converter.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tmx_converter.py b/tmx_converter.py index 9f9da39..6910176 100755 --- a/tmx_converter.py +++ b/tmx_converter.py @@ -265,9 +265,10 @@ class ContentHandler(xml.sax.ContentHandler): ]) ) elif isinstance(obj, Warp): - obj_name = obj.name[:23] + obj_name = obj.name[:19] if obj.name != obj_name: print('Warning: warp name truncated: %r -> %r' % (obj.name, obj_name)) + obj_name += "#" + str(main.name_unique) self.warps.write( SEPARATOR.join([ '%s,%d,%d' % (self.base, obj.x, obj.y), @@ -276,6 +277,7 @@ class ContentHandler(xml.sax.ContentHandler): '%d,%d,%s,%d,%d\n' % (obj.w, obj.h, obj.dest_map, obj.dest_tile_x, obj.dest_tile_y), ]) ) + main.name_unique += 1 if name == u'data': if self.state is State.DATA: @@ -317,6 +319,7 @@ def main(argv): tmx_dir = posixpath.join(client_data, CLIENT_MAPS) wlk_dir = posixpath.join(server_data, SERVER_WLK) npc_dir = posixpath.join(server_data, SERVER_NPCS) + main.name_unique = 0; if check_mobs: global mob_names mob_names = {} -- cgit v1.2.3-70-g09d2