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

Needed after the new Threat system
This commit is contained in:
sirikfoll
2018-01-17 19:01:09 -02:00
parent ed9e220991
commit e12e0ad582

View File

@@ -237,11 +237,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;
}