summaryrefslogtreecommitdiff
path: root/tmwcon
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-02-23 00:33:21 +0200
committerAndrei Karas <akaras@inbox.ru>2011-02-23 00:33:21 +0200
commit75834b41474c9c89457e71f3d9c5fb38f6fb57c0 (patch)
tree12e8f65df7d9d53901293f17f0fb02a49e622848 /tmwcon
parent916399eb1d8d4ea37d7fe4047656cc1cfce2736b (diff)
downloadevol-tools-75834b41474c9c89457e71f3d9c5fb38f6fb57c0.tar.gz
evol-tools-75834b41474c9c89457e71f3d9c5fb38f6fb57c0.tar.bz2
evol-tools-75834b41474c9c89457e71f3d9c5fb38f6fb57c0.tar.xz
evol-tools-75834b41474c9c89457e71f3d9c5fb38f6fb57c0.zip
tmwcon: add new warp attributes dest_tile_x, dest_tile_y.
Diffstat (limited to 'tmwcon')
-rw-r--r--tmwcon/src/converter/Process.java20
1 files changed, 15 insertions, 5 deletions
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) {