From 01cb2cceae3a179d3b18107a41580f8171712854 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Tue, 4 Nov 2014 20:22:00 -0800 Subject: Truncate warp names --- tmx_converter.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tmx_converter.py b/tmx_converter.py index d25430a..37a0234 100755 --- a/tmx_converter.py +++ b/tmx_converter.py @@ -276,11 +276,14 @@ class ContentHandler(xml.sax.ContentHandler): obj.dest_tile_x = obj.dest_x / 32; obj.dest_tile_y = obj.dest_y / 32; + obj_name = obj.name[:23] + if obj.name != obj_name: + print('Warning: warp name truncated: %r -> %r' % (obj.name, obj_name)) self.warps.write( SEPARATOR.join([ '%s.gat,%d,%d' % (self.base, obj.x, obj.y), 'warp', - obj.name, + obj_name, '%d,%d,%s.gat,%d,%d\n' % (obj.w, obj.h, obj.dest_map, obj.dest_tile_x, obj.dest_tile_y), ]) ) -- cgit v1.2.3-70-g09d2