summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-02-08 03:20:08 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-02-08 03:20:08 +0000
commit67157a6e028df10eec830f1cecdc6c395d3f48cc (patch)
tree921be597c847ec328d9a72fd7e145b907e40507b /src/map/battle.c
parent7c69ccc6452f8a31cf8d531c9684fc68ddd04452 (diff)
downloadhercules-67157a6e028df10eec830f1cecdc6c395d3f48cc.tar.gz
hercules-67157a6e028df10eec830f1cecdc6c395d3f48cc.tar.bz2
hercules-67157a6e028df10eec830f1cecdc6c395d3f48cc.tar.xz
hercules-67157a6e028df10eec830f1cecdc6c395d3f48cc.zip
- Modified battle_check_range to use check_range_bl rather than range_bl for range checking, as the range_bl aproximations can lead to situations where battle_check_range returns true while the attack function range check fails >.>
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5223 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 327bce020..9952ee076 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -3494,19 +3494,16 @@ 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)
{
- int arange;
-
nullpo_retr(0, src);
nullpo_retr(0, bl);
if(src->m != bl->m) // 違うマップ
return 0;
-
- arange = distance_bl(src, bl);
- if( range>0 && range < arange)
+
+ if (!check_distance_bl(src, bl, range))
return 0;
- if( arange<2 ) //No need for path checking.
+ if(distance_bl(src, bl) < 3) //No need for path checking.
return 1;
// ?瘧Q物判定