mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/CombatAI: Npcs with TurretAI will be able to attack again
Needed after the new Threat system
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user