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/bindings/scripts/include/sc_creature.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/bindings/scripts') diff --git a/src/bindings/scripts/include/sc_creature.cpp b/src/bindings/scripts/include/sc_creature.cpp index b18d018c5a9..a5401b8100d 100644 --- a/src/bindings/scripts/include/sc_creature.cpp +++ b/src/bindings/scripts/include/sc_creature.cpp @@ -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(); -- cgit v1.2.3