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://svn.code.sf.net/p/rathena/svn/trunk@16054 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
shennetsind 2012-05-03 00:38:48 +00:00
parent 6503d74922
commit ce563255a2

View File

@ -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;