From dc45b9c29cfcf7c64f95dc9f81b1612dda68341d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 10 Sep 2015 19:12:45 +0300 Subject: Add to path search functions source bl for plugins usage. --- src/map/map.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/map/map.c') 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) { -- cgit v1.2.3-60-g2f50