summaryrefslogtreecommitdiff
path: root/src/map/path.c
diff options
context:
space:
mode:
authorcelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-03-07 11:35:13 +0000
committercelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-03-07 11:35:13 +0000
commit24ec5cc01a034fe378bc0e8dfb7426a2dbbf8563 (patch)
treeb5c5bcfdd52bea7f5b223653e24e757d1369551a /src/map/path.c
parent4bd24425858e186737a3dd60bbe1ee2f3a4a4e67 (diff)
downloadhercules-24ec5cc01a034fe378bc0e8dfb7426a2dbbf8563.tar.gz
hercules-24ec5cc01a034fe378bc0e8dfb7426a2dbbf8563.tar.bz2
hercules-24ec5cc01a034fe378bc0e8dfb7426a2dbbf8563.tar.xz
hercules-24ec5cc01a034fe378bc0e8dfb7426a2dbbf8563.zip
* 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
Diffstat (limited to 'src/map/path.c')
-rw-r--r--src/map/path.c23
1 files changed, 20 insertions, 3 deletions
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->len<MAX_WALKPATH) {
+ spd->x[spd->len] = x0;
+ spd->y[spd->len] = y0;
+ spd->len++;
+ }
}
return 1;