From 3ff61beafa9f028e582c4d810b93352aa85b18a7 Mon Sep 17 00:00:00 2001 From: sirikfoll Date: Wed, 17 Jan 2018 19:01:09 -0200 Subject: Core/CombatAI: Npcs with TurretAI will be able to attack again Needed after the new Threat system (cherry picked from commit e12e0ad5827d7e794baa630724069680d7e07cfb) --- src/server/game/AI/CoreAI/CombatAI.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/server') diff --git a/src/server/game/AI/CoreAI/CombatAI.cpp b/src/server/game/AI/CoreAI/CombatAI.cpp index 6033992071f..5559408e387 100644 --- a/src/server/game/AI/CoreAI/CombatAI.cpp +++ b/src/server/game/AI/CoreAI/CombatAI.cpp @@ -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; } -- cgit v1.2.3