summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
authorInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-07-11 04:48:40 +0000
committerInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-07-11 04:48:40 +0000
commit3317a790778189da1ad69f75947c519f0d0b3563 (patch)
treeaeea761a20b51c8dba4b3ae4247b5dbe799da60e /src/map/battle.c
parent488848a43c44e4c3e29a9d8947f309c36ef5d192 (diff)
downloadhercules-3317a790778189da1ad69f75947c519f0d0b3563.tar.gz
hercules-3317a790778189da1ad69f75947c519f0d0b3563.tar.bz2
hercules-3317a790778189da1ad69f75947c519f0d0b3563.tar.xz
hercules-3317a790778189da1ad69f75947c519f0d0b3563.zip
* Some updates for range check. (bugreport:3339)
- Monsters shouldn't use skills if the target is within its attack range but is out of the skill range. - Monsters' skill range is no longer 9 by default. - Range for players' attacks and skills should always check for a circular area. - The range of Magnetic Earth is 2. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13944 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 221c2c2de..0474d82a0 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -3430,6 +3430,15 @@ bool battle_check_range(struct block_list *src, struct block_list *bl, int range
if( src->m != bl->m )
return false;
+#ifndef CIRCULAR_AREA
+ if( src->type == BL_PC )
+ { // Range for players' attacks and skills should always have a circular check. [Inkfish]
+ 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)) )
+ return false;
+ }
+ else
+#endif
if( !check_distance_bl(src, bl, range) )
return false;