From c13d83796f7b2111c5dcf8546bdd84eccd232ae3 Mon Sep 17 00:00:00 2001 From: Treeston Date: Sun, 21 Jul 2019 01:49:58 +0200 Subject: Core/AI: Finally move the "is creature engaged" flag to be a property of the creature AI, where it honestly always belonged. Fixes #17981 and #23602 for real this time. (cherry picked from commit 0e7c66cb4c7ff7d44e232d0b50703a48605ffd24) --- .../Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp | 7 +++---- .../scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp | 2 +- src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp | 2 +- src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp | 2 +- src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp | 2 +- src/server/scripts/Northrend/zone_borean_tundra.cpp | 1 - 6 files changed, 7 insertions(+), 9 deletions(-) (limited to 'src/server/scripts/Northrend') diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp index 84015ecb287..fc5fdbceb4d 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp @@ -580,7 +580,7 @@ struct gunship_npc_AI : public ScriptedAI return; me->CombatStop(true); - me->GetThreatManager().NotifyDisengaged(); + EngagementOver(); me->GetMotionMaster()->MoveTargetedHome(); } @@ -725,7 +725,6 @@ class npc_gunship : public CreatureScript Creature* stalker = *itr; stalker->RemoveAllAuras(); stalker->CombatStop(true); - stalker->GetThreatManager().NotifyDisengaged(); } uint32 explosionSpell = isVictory ? SPELL_EXPLOSION_VICTORY : SPELL_EXPLOSION_WIPE; @@ -878,7 +877,7 @@ class npc_high_overlord_saurfang_igb : public CreatureScript return; me->CombatStop(true); - me->GetThreatManager().NotifyDisengaged(); + EngagementOver(); me->GetMotionMaster()->MoveTargetedHome(); Reset(); @@ -1142,7 +1141,7 @@ class npc_muradin_bronzebeard_igb : public CreatureScript return; me->CombatStop(true); - me->GetThreatManager().NotifyDisengaged(); + EngagementOver(); me->GetMotionMaster()->MoveTargetedHome(); Reset(); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp index f7a1878b6e0..b4f61407615 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_the_lich_king.cpp @@ -1778,7 +1778,7 @@ class npc_terenas_menethil : public CreatureScript return; me->CombatStop(false); - me->GetThreatManager().NotifyDisengaged(); + EngagementOver(); } void DamageTaken(Unit* /*attacker*/, uint32& damage) override diff --git a/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp b/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp index bf58171cfb7..e16da9ab00f 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp @@ -122,7 +122,7 @@ public: ThreatReference* secondThreat = nullptr; ThreatReference* thirdThreat = nullptr; - ThreatManager const& mgr = me->GetThreatManager(); + ThreatManager& mgr = me->GetThreatManager(); Unit* currentVictim = mgr.GetCurrentVictim(); auto list = mgr.GetModifiableThreatList(); auto it = list.begin(), end = list.end(); diff --git a/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp b/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp index c1e6a515863..4775540bd6b 100644 --- a/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp +++ b/src/server/scripts/Northrend/Nexus/Oculus/boss_urom.cpp @@ -293,7 +293,7 @@ class boss_urom : public CreatureScript { me->RemoveAllAuras(); me->CombatStop(false); - me->GetThreatManager().NotifyDisengaged(); + EngagementOver(); } void SpellHit(Unit* /*caster*/, SpellInfo const* spellInfo) override diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp index 28c983e3ab6..700ab396c65 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_freya.cpp @@ -634,7 +634,7 @@ class boss_freya : public CreatureScript Elder->RemoveAllAuras(); Elder->AttackStop(); Elder->CombatStop(true); - Elder->GetThreatManager().NotifyDisengaged(); + EngagementOver(); Elder->AI()->DoAction(ACTION_ELDER_FREYA_KILLED); } } diff --git a/src/server/scripts/Northrend/zone_borean_tundra.cpp b/src/server/scripts/Northrend/zone_borean_tundra.cpp index 6d488fd5112..2677be16d0b 100644 --- a/src/server/scripts/Northrend/zone_borean_tundra.cpp +++ b/src/server/scripts/Northrend/zone_borean_tundra.cpp @@ -751,7 +751,6 @@ public: Creature* owner = GetOwner()->ToCreature(); owner->RemoveAllAurasExceptType(SPELL_AURA_DUMMY); owner->CombatStop(true); - owner->GetThreatManager().NotifyDisengaged(); owner->GetMotionMaster()->Clear(); owner->GetMotionMaster()->MoveFollow(GetCaster(), 4.0f, 0.0f); owner->CastSpell(owner, SPELL_SUBDUED, true); -- cgit v1.2.3