From 672d304a4478afa58d6e094b1bf53ae25b176356 Mon Sep 17 00:00:00 2001 From: megamage Date: Sun, 19 Oct 2008 14:42:12 -0500 Subject: [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 --- src/game/Player.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/game/Player.cpp') diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 694c9eafc7b..32413aba503 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -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); } -- cgit v1.2.3