From ebf1cd085c9f4061318f99f9ab19b63148d19819 Mon Sep 17 00:00:00 2001 From: ultramage Date: Sat, 22 Dec 2007 13:00:48 +0000 Subject: Path code cleaning... * Added map/path.h, moved path-related function headers to path.h. * Removed the macroed _real() path functions. * Modified some functions to use boolean return values instead of 1/0 or 0/-1. * Modified path_search_long() to allow a NULL output pointer (in which case a temporary local buffer will be used instead). * Removed an unused ->path_half member variable from struct walkpath_data. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11958 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/battle.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/map/battle.c') diff --git a/src/map/battle.c b/src/map/battle.c index f9dbb636e..142db46db 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -11,6 +11,7 @@ #include "../common/utils.h" #include "map.h" +#include "path.h" #include "pc.h" #include "status.h" #include "skill.h" @@ -3274,25 +3275,25 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f /*========================================== * 射程判定 *------------------------------------------*/ -int 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) { - nullpo_retr(0, src); - nullpo_retr(0, bl); + nullpo_retr(false, src); + nullpo_retr(false, bl); if(src->m != bl->m) // 違うマップ - return 0; + return false; if(src->type == BL_HOM && battle_config.hom_setting&0x2) range = battle_config.area_size + 1; //WTF, way to go Aegis and your awesome bugs. if (!check_distance_bl(src, bl, range)) - return 0; + return false; if(distance_bl(src, bl) < 2) //No need for path checking. - return 1; + return true; // ?瘧Q物判定 - return path_search_long(NULL,src->m,src->x,src->y,bl->x,bl->y); + return path_search_long(NULL,src->m,src->x,src->y,bl->x,bl->y,CELL_CHKWALL); } static const struct _battle_data { -- cgit v1.2.3-60-g2f50