From 75834b41474c9c89457e71f3d9c5fb38f6fb57c0 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 23 Feb 2011 00:33:21 +0200 Subject: tmwcon: add new warp attributes dest_tile_x, dest_tile_y. --- tmwcon/src/converter/Process.java | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'tmwcon') diff --git a/tmwcon/src/converter/Process.java b/tmwcon/src/converter/Process.java index 5241e81..2e7103e 100644 --- a/tmwcon/src/converter/Process.java +++ b/tmwcon/src/converter/Process.java @@ -75,13 +75,23 @@ public class Process { if (out == null) return; String dest = getProp(props, "dest_map", null); if (dest == null) return; - int x = getProp(props, "dest_x", -1); - if (x < 0) return; - int y = getProp(props, "dest_y", -1); - if (y < 0) return; + int x = getProp(props, "dest_tile_x", -1); + if (x < 0) + { + x = getProp(props, "dest_x", -1); + if (x < 0) return; + x = Math.round((float)x / (float)32); + } + int y = getProp(props, "dest_tile_y", -1); + if (y < 0) + { + y = getProp(props, "dest_y", -1); + if (y < 0) return; + y = Math.round((float)y / (float)32); + } int[] shape = resolveBounds(bounds, true); System.out.printf("Usable warp found: %s\n", name); - out.printf("%s.gat,%d,%d\twarp\t%s\t%d,%d,%s.gat,%d,%d\n", map, shape[0], shape[1], name, shape[2], shape[3], dest, Math.round((float)x / (float)32), Math.round((float)y / (float)32)); + out.printf("%s.gat,%d,%d\twarp\t%s\t%d,%d,%s.gat,%d,%d\n", map, shape[0], shape[1], name, shape[2], shape[3], dest, x, y); } private static int handleMob(PrintWriter out, String map, String name, Rectangle bounds, Properties props) { -- cgit v1.2.3-70-g09d2