Core/CombatAI: Npcs with TurretAI will be able to attack again

Needed after the new Threat system

(cherry picked from commit e12e0ad582)
This commit is contained in:
sirikfoll
2018-01-17 19:01:09 -02:00
committed by Shauren
parent 78577afa49
commit 3ff61beafa

View File

@@ -248,11 +248,11 @@ TurretAI::TurretAI(Creature* c) : CreatureAI(c)
me->m_SightDistance = me->m_CombatDistance;
}
bool TurretAI::CanAIAttack(Unit const* /*who*/) const
bool TurretAI::CanAIAttack(Unit const* who) const
{
/// @todo use one function to replace it
if (!me->IsWithinCombatRange(me->GetVictim(), me->m_CombatDistance)
|| (m_minRange && me->IsWithinCombatRange(me->GetVictim(), m_minRange)))
if (!me->IsWithinCombatRange(who, me->m_CombatDistance)
|| (m_minRange && me->IsWithinCombatRange(who, m_minRange)))
return false;
return true;
}