aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsirikfoll <sirikfoll@hotmail.com>2018-01-17 19:01:09 -0200
committerShauren <shauren.trinity@gmail.com>2021-06-16 11:26:22 +0200
commit3ff61beafa9f028e582c4d810b93352aa85b18a7 (patch)
tree3cbad8c6525b74555cd7fe3cb3bfc1b471420a01 /src
parent78577afa4900a0b83c9f33e5f94f15f9f51de8c7 (diff)
Core/CombatAI: Npcs with TurretAI will be able to attack again
Needed after the new Threat system (cherry picked from commit e12e0ad5827d7e794baa630724069680d7e07cfb)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AI/CoreAI/CombatAI.cpp6
1 files changed, 3 insertions, 3 deletions
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;
}