[11105] Melee attacks distance

Inspired by patch provided by Feanordev.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
Schmoozerd 2011-02-03 00:35:53 +03:00 committed by VladimirMangos
parent aa4c1be8cf
commit 8e68d1bcaf
13 changed files with 77 additions and 43 deletions

View file

@ -1370,7 +1370,7 @@ void CreatureEventAI::DoMeleeAttackIfReady()
if (m_creature->isAttackReady())
{
//If we are within range melee the target
if (m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE))
if (m_creature->CanReachWithMeleeAttack(m_creature->getVictim()))
{
m_creature->AttackerStateUpdate(m_creature->getVictim());
m_creature->resetAttackTimer();