*Update melee range calculation. By QAston.
--HG-- branch : trunk
This commit is contained in:
1 parent
d36672cd7e
commit
3a1293ef18
34 files changed
+93
-138
No files matched your search
@@ -130,7 +130,7 @@ void ScriptedAI::UpdateAI(const uint32 diff)
|
||||
if (m_creature->isAttackReady() )
|
||||
{
|
||||
//If we are within range melee the target
|
||||
if (m_creature->IsWithinCombatDist(m_creature->getVictim(), ATTACK_DISTANCE))
|
||||
if (m_creature->IsWithinMeleeRange(m_creature->getVictim()))
|
||||
{
|
||||
m_creature->AttackerStateUpdate(m_creature->getVictim());
|
||||
m_creature->resetAttackTimer();
|
||||
@@ -193,7 +193,7 @@ void ScriptedAI::DoMeleeAttackIfReady()
|
||||
if (m_creature->isAttackReady() && !m_creature->hasUnitState(UNIT_STAT_CASTING))
|
||||
{
|
||||
//If we are within range melee the target
|
||||
if (m_creature->IsWithinCombatDist(m_creature->getVictim(), ATTACK_DISTANCE))
|
||||
if (m_creature->IsWithinMeleeRange(m_creature->getVictim()))
|
||||
{
|
||||
m_creature->AttackerStateUpdate(m_creature->getVictim());
|
||||
m_creature->resetAttackTimer();
|
||||
@@ -202,7 +202,7 @@ void ScriptedAI::DoMeleeAttackIfReady()
|
||||
if (m_creature->haveOffhandWeapon() && m_creature->isAttackReady(OFF_ATTACK) && !m_creature->hasUnitState(UNIT_STAT_CASTING))
|
||||
{
|
||||
//If we are within range melee the target
|
||||
if (m_creature->IsWithinCombatDist(m_creature->getVictim(), ATTACK_DISTANCE))
|
||||
if (m_creature->IsWithinMeleeRange(m_creature->getVictim()))
|
||||
{
|
||||
m_creature->AttackerStateUpdate(m_creature->getVictim(), OFF_ATTACK);
|
||||
m_creature->resetAttackTimer(OFF_ATTACK);
|
||||
|
||||
Reference in new issue
Block a user