aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/AI/CreatureAI.cpp
diff options
context:
space:
mode:
authortreeston <treeston.mmoc@gmail.com>2016-02-22 23:00:15 +0100
committerShauren <shauren.trinity@gmail.com>2016-04-08 20:38:22 +0200
commit4726116dbc07e49d854c2805af1dcf4485d662f9 (patch)
tree6ac2230960c8e587beed17e9cbe42759705827ca /src/server/game/AI/CreatureAI.cpp
parent8046d5a94f9b4cea88e0042fb2adf2f74de5d942 (diff)
Core/Threat: Prevent bosses (and other stuff using DoZoneInCombat) from switching off of the person pulling if they are pulled without generating threat.
(cherry picked from commit b5b7ce44cfeb98bf47eb6c9e0c926994ad53ede8)
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