[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
+1 -1
View File
@@ -133,7 +133,7 @@ void ScriptedAI::DoMeleeAttackIfReady()
if( m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false))
{
//If we are within range melee the target
if( m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
if( m_creature->IsWithinCombatDist(m_creature->getVictim(), ATTACK_DISTANCE))
{
m_creature->AttackerStateUpdate(m_creature->getVictim());
m_creature->resetAttackTimer();