aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/AI/CreatureAI.cpp
diff options
context:
space:
mode:
authorTreeston <treeston.mmoc@gmail.com>2016-02-27 15:59:43 +0100
committerTreeston <treeston.mmoc@gmail.com>2016-02-27 15:59:43 +0100
commit79a945d5e573b48733ee5094a3c738a5d8904dbc (patch)
tree1cba6d8f712d2fae986abba7ef33f0026270fbdc /src/server/game/AI/CreatureAI.cpp
parent31cd082833926539c56569ff6faabc139f5f3223 (diff)
parentb5b7ce44cfeb98bf47eb6c9e0c926994ad53ede8 (diff)
Merge pull request #16666 from Treeston/3.3.5-bodypull
[3.3.5] Fix bosses losing interest in the person running at them
Diffstat (limited to 'src/server/game/AI/CreatureAI.cpp')
-rw-r--r--src/server/game/AI/CreatureAI.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp
index 352ae635878..33de8b09123 100644
--- a/src/server/game/AI/CreatureAI.cpp
+++ b/src/server/game/AI/CreatureAI.cpp
@@ -134,7 +134,10 @@ void CreatureAI::MoveInLineOfSight(Unit* who)
return;
if (me->HasReactState(REACT_AGGRESSIVE) && me->CanStartAttack(who, false))
+ {
+ me->AddThreat(who, 0.0f); // ensure our initial target is the first thing added to threat list so we don't randomly switch off if DoZoneInCombat is called during the EnterCombat hook
AttackStart(who);
+ }
//else if (who->GetVictim() && me->IsFriendlyTo(who)
// && me->IsWithinDistInMap(who, sWorld->getIntConfig(CONFIG_CREATURE_FAMILY_ASSISTANCE_RADIUS))
// && me->CanStartAttack(who->GetVictim(), true)) /// @todo if we use true, it will not attack it when it arrives