diff options
author | shennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-05-03 00:38:48 +0000 |
---|---|---|
committer | shennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-05-03 00:38:48 +0000 |
commit | c05e368aead0afeb1fb477b6f1566a297dcdc957 (patch) | |
tree | df96e7ead9aad0e69e04fba001dbf6bec526ace8 /src/map/battle.c | |
parent | e553f18ce08349021db2f0ffe42f9c161daabb50 (diff) | |
download | hercules-c05e368aead0afeb1fb477b6f1566a297dcdc957.tar.gz hercules-c05e368aead0afeb1fb477b6f1566a297dcdc957.tar.bz2 hercules-c05e368aead0afeb1fb477b6f1566a297dcdc957.tar.xz hercules-c05e368aead0afeb1fb477b6f1566a297dcdc957.zip |
Fixed bugreport:3452 players' circular target range is now matching official servers. credits goes all to Angezerus for his formula and fix.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16054 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/battle.c')
-rw-r--r-- | src/map/battle.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/map/battle.c b/src/map/battle.c index ce75e0446..113d82fbf 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -4859,13 +4859,11 @@ bool battle_check_range(struct block_list *src, struct block_list *bl, int range return false; #ifndef CIRCULAR_AREA - if( src->type == BL_PC ) - { // Range for players' attacks and skills should always have a circular check. [Inkfish] + if( src->type == BL_PC ) { // Range for players' attacks and skills should always have a circular check. [Angezerus] int dx = src->x - bl->x, dy = src->y - bl->y; - if( !check_distance(dx*dx + dy*dy, 0, range*range+(dx&&dy?1:0)) ) + if( !check_distance(dx, dy, range) ) return false; - } - else + } else #endif if( !check_distance_bl(src, bl, range) ) return false; |