Partial revert of fcf58e7 (both check performed inside IsInMeleeRange)
This commit is contained in:
@@ -43,29 +43,19 @@ void UnitAI::DoMeleeAttackIfReady()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
Unit *victim = me->getVictim();
|
Unit *victim = me->getVictim();
|
||||||
if (!victim || !victim->IsInWorld())
|
|
||||||
return;
|
|
||||||
|
|
||||||
//Make sure our attack is ready and we aren't currently casting before checking distance
|
//Make sure our attack is ready and we aren't currently casting before checking distance
|
||||||
if (me->isAttackReady())
|
if (me->isAttackReady() && me->IsWithinMeleeRange(victim))
|
||||||
{
|
|
||||||
//If we are within range melee the target
|
|
||||||
if (me->IsWithinMeleeRange(victim))
|
|
||||||
{
|
{
|
||||||
me->AttackerStateUpdate(victim);
|
me->AttackerStateUpdate(victim);
|
||||||
me->resetAttackTimer();
|
me->resetAttackTimer();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (me->haveOffhandWeapon() && me->isAttackReady(OFF_ATTACK))
|
if (me->haveOffhandWeapon() && me->isAttackReady(OFF_ATTACK) && me->IsWithinMeleeRange(victim))
|
||||||
{
|
|
||||||
//If we are within range melee the target
|
|
||||||
if (me->IsWithinMeleeRange(victim))
|
|
||||||
{
|
{
|
||||||
me->AttackerStateUpdate(victim, OFF_ATTACK);
|
me->AttackerStateUpdate(victim, OFF_ATTACK);
|
||||||
me->resetAttackTimer(OFF_ATTACK);
|
me->resetAttackTimer(OFF_ATTACK);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
bool UnitAI::DoSpellAttackIfReady(uint32 spell)
|
bool UnitAI::DoSpellAttackIfReady(uint32 spell)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user