summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-12-22 13:00:48 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-12-22 13:00:48 +0000
commitebf1cd085c9f4061318f99f9ab19b63148d19819 (patch)
tree876e3d2c2bc05cbce67604eaa734a741410fb3bf /src/map/battle.c
parent5f857bae116433a2a0fd38b8c3539352c5453f7a (diff)
downloadhercules-ebf1cd085c9f4061318f99f9ab19b63148d19819.tar.gz
hercules-ebf1cd085c9f4061318f99f9ab19b63148d19819.tar.bz2
hercules-ebf1cd085c9f4061318f99f9ab19b63148d19819.tar.xz
hercules-ebf1cd085c9f4061318f99f9ab19b63148d19819.zip
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
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c15
1 files changed, 8 insertions, 7 deletions
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 {