diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2014-11-04 20:22:00 -0800 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2014-11-04 20:23:42 -0800 |
commit | 01cb2cceae3a179d3b18107a41580f8171712854 (patch) | |
tree | c900de53925188804726ce1c15a3035fc5e34eb5 | |
parent | 892ea43622c7fe1868aa3507d7ff1b2dd3ccedd5 (diff) | |
download | tools-01cb2cceae3a179d3b18107a41580f8171712854.tar.gz tools-01cb2cceae3a179d3b18107a41580f8171712854.tar.bz2 tools-01cb2cceae3a179d3b18107a41580f8171712854.tar.xz tools-01cb2cceae3a179d3b18107a41580f8171712854.zip |
Truncate warp names
-rwxr-xr-x | tmx_converter.py | 5 |
1 files changed, 4 insertions, 1 deletions
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), ]) ) |