From 24ec5cc01a034fe378bc0e8dfb7426a2dbbf8563 Mon Sep 17 00:00:00 2001 From: celest Date: Mon, 7 Mar 2005 11:35:13 +0000 Subject: * Updated core and map-server to jA 1115~1137 * Fixed a typo in Volcano git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1206 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/path.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'src/map/path.c') diff --git a/src/map/path.c b/src/map/path.c index 92ea4941e..c2b852469 100644 --- a/src/map/path.c +++ b/src/map/path.c @@ -246,7 +246,7 @@ int path_blownpos(int m,int x0,int y0,int dx,int dy,int count) *------------------------------------------ */ #define swap(x,y) { int t; t = x; x = y; y = t; } -int path_search_long(int m,int x0,int y0,int x1,int y1) +int path_search_long(struct shootpath_data *spd,int m,int x0,int y0,int x1,int y1) { int dx, dy; int wx = 0, wy = 0; @@ -265,13 +265,25 @@ int path_search_long(int m,int x0,int y0,int x1,int y1) } dy = (y1 - y0); + if (spd) { + spd->rx = spd->ry = 0; + spd->len = 1; + spd->x[0] = x0; + spd->y[0] = y0; + } + if (map_getcellp(md,x1,y1,CELL_CHKWALL)) return 0; - if (dx > abs(dy)) + if (dx > abs(dy)) { weight = dx; - else + if (spd) + spd->ry=1; + } else { weight = abs(y1 - y0); + if (spd) + spd->rx=1; + } while (x0 != x1 || y0 != y1) { if (map_getcellp(md,x0,y0,CELL_CHKWALL)) @@ -289,6 +301,11 @@ int path_search_long(int m,int x0,int y0,int x1,int y1) wy += weight; y0 --; } + if (spd && spd->lenx[spd->len] = x0; + spd->y[spd->len] = y0; + spd->len++; + } } return 1; -- cgit v1.2.3-70-g09d2