diff options
author | Haruna <haru@dotalux.com> | 2015-09-12 19:55:55 +0200 |
---|---|---|
committer | Haruna <haru@dotalux.com> | 2015-09-12 19:55:55 +0200 |
commit | 41ba7b50888610d43dcf3bcccb77ee3debe13532 (patch) | |
tree | 8abd38674459f4c53a077684521ec9de883d7782 /src/map/map.c | |
parent | d8caa7c8e7296a87072b6775902b985a1faebadf (diff) | |
parent | 23f06359b540d369eff74d5454d2fe58b38b9630 (diff) | |
download | hercules-41ba7b50888610d43dcf3bcccb77ee3debe13532.tar.gz hercules-41ba7b50888610d43dcf3bcccb77ee3debe13532.tar.bz2 hercules-41ba7b50888610d43dcf3bcccb77ee3debe13532.tar.xz hercules-41ba7b50888610d43dcf3bcccb77ee3debe13532.zip |
Merge pull request #713 from 4144/pathext
Add to path search functions source bl for plugins usage.
Diffstat (limited to 'src/map/map.c')
-rw-r--r-- | src/map/map.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/map/map.c b/src/map/map.c index 6e35e6bb6..ab34799ee 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -840,7 +840,7 @@ static int bl_vgetall_inshootrange(struct block_list *bl, va_list args) if (!check_distance_bl(center, bl, range)) return 0; #endif - if (!path->search_long(NULL, center->m, center->x, center->y, bl->x, bl->y, CELL_CHKWALL)) + if (!path->search_long(NULL, center, center->m, center->x, center->y, bl->x, bl->y, CELL_CHKWALL)) return 0; return 1; } @@ -1195,7 +1195,7 @@ static int bl_vgetall_inpath(struct block_list *bl, va_list args) if ( k < 0 || k > len_limit ) //Since more skills use this, check for ending point as well. return 0; - if ( k > magnitude2 && !path->search_long(NULL, m, x0, y0, xi, yi, CELL_CHKWALL) ) + if ( k > magnitude2 && !path->search_long(NULL, NULL, m, x0, y0, xi, yi, CELL_CHKWALL) ) return 0; //Targets beyond the initial ending point need the wall check. //All these shifts are to increase the precision of the intersection point and distance considering how it's @@ -2567,7 +2567,7 @@ int map_random_dir(struct block_list *bl, int16 *x, int16 *y) xi = bl->x + segment*dirx[j]; segment = (short)sqrt((float)(dist2 - segment*segment)); //The complement of the previously picked segment yi = bl->y + segment*diry[j]; - } while ( (map->getcell(bl->m,xi,yi,CELL_CHKNOPASS) || !path->search(NULL,bl->m,bl->x,bl->y,xi,yi,1,CELL_CHKNOREACH)) + } while ( (map->getcell(bl->m,xi,yi,CELL_CHKNOPASS) || !path->search(NULL,bl,bl->m,bl->x,bl->y,xi,yi,1,CELL_CHKNOREACH)) && (++i)<100 ); if (i < 100) { |