[svn] Add Unit::IsWithinCombatDist function to check melee range and spell range (now range is related to the attacker's bounding_radius and target's combat_reach, not sure if both should be combat_reach).

--HG--
branch : trunk
This commit is contained in:
megamage
2008-10-19 14:42:12 -05:00
parent e7519059c9
commit 672d304a44
5 changed files with 21 additions and 6 deletions
+2 -2
View File
@@ -1056,7 +1056,7 @@ void Player::Update( uint32 p_time )
if (isAttackReady(BASE_ATTACK))
{
if(!IsWithinDistInMap(pVictim, pldistance))
if(!IsWithinCombatDist(pVictim, pldistance))
{
setAttackTimer(BASE_ATTACK,100);
if(m_swingErrorMsg != 1) // send single time (client auto repeat)
@@ -1093,7 +1093,7 @@ void Player::Update( uint32 p_time )
if ( haveOffhandWeapon() && isAttackReady(OFF_ATTACK))
{
if(!IsWithinDistInMap(pVictim, pldistance))
if(!IsWithinCombatDist(pVictim, pldistance))
{
setAttackTimer(OFF_ATTACK,100);
}