From 13295bb20062f0b2e957bf377ef3367034be740b Mon Sep 17 00:00:00 2001 From: Aokromes Date: Sun, 21 Jan 2018 12:54:46 +0100 Subject: [PATCH] Core/CombatAI: Npcs with TurretAI will be able to attack again --- src/server/game/AI/CoreAI/CombatAI.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/server/game/AI/CoreAI/CombatAI.cpp b/src/server/game/AI/CoreAI/CombatAI.cpp index 2e42e186605..c6cdf4aea4e 100644 --- a/src/server/game/AI/CoreAI/CombatAI.cpp +++ b/src/server/game/AI/CoreAI/CombatAI.cpp @@ -232,11 +232,11 @@ TurretAI::TurretAI(Creature* c) : CreatureAI(c) me->m_SightDistance = me->m_CombatDistance; } -bool TurretAI::CanAIAttack(const Unit* /*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; }