|
@@ -3269,6 +3269,7 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
|
|
*------------------------------------------*/
|
|
*------------------------------------------*/
|
|
bool battle_check_range(struct block_list *src,struct block_list *bl,int range)
|
|
bool battle_check_range(struct block_list *src,struct block_list *bl,int range)
|
|
{
|
|
{
|
|
|
|
+ int d;
|
|
nullpo_retr(false, src);
|
|
nullpo_retr(false, src);
|
|
nullpo_retr(false, bl);
|
|
nullpo_retr(false, bl);
|
|
|
|
|
|
@@ -3281,9 +3282,12 @@ bool battle_check_range(struct block_list *src,struct block_list *bl,int range)
|
|
if (!check_distance_bl(src, bl, range))
|
|
if (!check_distance_bl(src, bl, range))
|
|
return false;
|
|
return false;
|
|
|
|
|
|
- if(distance_bl(src, bl) < 2) //No need for path checking.
|
|
|
|
|
|
+ if((d=distance_bl(src, bl)) < 2) //No need for path checking.
|
|
return true;
|
|
return true;
|
|
|
|
|
|
|
|
+ if (d> AREA_SIZE)
|
|
|
|
+ return false; //Avoid targetting objects beyond your range of sight.
|
|
|
|
+
|
|
// ?áŠQ•¨”»’è
|
|
// ?áŠQ•¨”»’è
|
|
return path_search_long(NULL,src->m,src->x,src->y,bl->x,bl->y,CELL_CHKWALL);
|
|
return path_search_long(NULL,src->m,src->x,src->y,bl->x,bl->y,CELL_CHKWALL);
|
|
}
|
|
}
|