From cb40e383b3c8750378afe9437a155fd051f87e98 Mon Sep 17 00:00:00 2001 From: Vitaly Driedfruit Date: Tue, 30 Apr 2013 04:26:28 +0400 Subject: [PATCH] Fix bug in get_path, use the newer version of it. --- src/ai.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ai.c b/src/ai.c index 3719dad..d1e041a 100644 --- a/src/ai.c +++ b/src/ai.c @@ -60,7 +60,7 @@ int get_closest(const long *cost, levelpos_t src, int *xx, int *xy) { } int get_path(const int *prev, levelpos_t src, levelpos_t dest, int *xx, int *xy) { -#if 1 +#if 0 if (dest == -1) return -1; if (prev[dest] == src) { @@ -79,8 +79,8 @@ int get_path(const int *prev, levelpos_t src, levelpos_t dest, int *xx, int *xy) } dest = prev[dest]; } - *xx = (dest / level_w); - *xy = (dest % level_w); + *xy = (dest / level_w); + *xx = (dest % level_w); return 0; #endif } -- 2.11.4.GIT