diff options
Diffstat (limited to 'src/server/scripts/Northrend')
6 files changed, 10 insertions, 14 deletions
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp index 01b8ce4ad73..40301954ecb 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_faction_champions.cpp @@ -610,7 +610,7 @@ struct boss_faction_championsAI : public BossAI void UpdateThreat() { - for (ThreatReference* ref : me->GetThreatManager().GetUnsortedThreatList()) + for (ThreatReference* ref : me->GetThreatManager().GetModifiableThreatList()) if (Player* victim = ref->GetVictim()->ToPlayer()) ref->SetThreat(1000000.0f * CalculateThreat(me->GetDistance2d(victim), victim->GetArmor(), victim->GetHealth())); } @@ -695,7 +695,7 @@ struct boss_faction_championsAI : public BossAI uint32 EnemiesInRange(float distance) { uint32 count = 0; - for (ThreatReference* ref : me->GetThreatManager().GetUnsortedThreatList()) + for (ThreatReference const* ref : me->GetThreatManager().GetUnsortedThreatList()) if (me->GetDistance2d(ref->GetVictim()) < distance) ++count; return count; diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp index 5b839e2e77e..5fa460e3370 100644 --- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp @@ -960,12 +960,9 @@ class npc_jaina_or_sylvanas_escape_hor : public CreatureScript void DeleteAllFromThreatList(Unit* target, ObjectGuid except) { - std::vector<ThreatReference*> toClear; - for (ThreatReference* ref : target->GetThreatManager().GetUnsortedThreatList()) + for (ThreatReference* ref : target->GetThreatManager().GetModifiableThreatList()) if (ref->GetVictim()->GetGUID() != except) - toClear.push_back(ref); - for (ThreatReference* ref : toClear) - ref->ClearThreat(); + ref->ClearThreat(); } void UpdateAI(uint32 diff) override diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp index bb394bdbafc..33978ff7e16 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_blood_queen_lana_thel.cpp @@ -490,7 +490,7 @@ class boss_blood_queen_lana_thel : public CreatureScript std::list<Player*> tempTargets; Unit* maintank = me->GetThreatManager().GetCurrentVictim(); - for (ThreatReference* ref : me->GetThreatManager().GetUnsortedThreatList()) + for (ThreatReference const* ref : me->GetThreatManager().GetUnsortedThreatList()) if (Player* refTarget = ref->GetVictim()->ToPlayer()) if (refTarget != maintank && (includeOfftank || (refTarget->GetGUID() != _offtankGUID))) tempTargets.push_back(refTarget->ToPlayer()); diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp index 47cfb36b759..9eec05cf352 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_professor_putricide.cpp @@ -505,7 +505,7 @@ class boss_professor_putricide : public CreatureScript { std::list<Unit*> targetList; { - for (ThreatReference* ref : me->GetThreatManager().GetUnsortedThreatList()) + for (ThreatReference const* ref : me->GetThreatManager().GetUnsortedThreatList()) if (Player* target = ref->GetVictim()->ToPlayer()) targetList.push_back(target); } diff --git a/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp b/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp index e6fd7ea3e15..85b51f14b12 100644 --- a/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp +++ b/src/server/scripts/Northrend/Naxxramas/boss_patchwerk.cpp @@ -124,8 +124,8 @@ public: ThreatManager const& mgr = me->GetThreatManager(); Unit* currentVictim = mgr.GetCurrentVictim(); - auto const& pair = mgr.GetSortedThreatList(); - auto it = pair.begin(), end = pair.end(); + auto list = mgr.GetModifiableThreatList(); + auto it = list.begin(), end = list.end(); if (it == end) EnterEvadeMode(EVADE_REASON_NO_HOSTILES); @@ -151,8 +151,7 @@ public: DoCast(pHatefulTarget, SPELL_HATEFUL_STRIKE, true); // add threat to highest threat targets - if (me->GetVictim() && me->IsWithinMeleeRange(me->GetVictim())) - AddThreat(me->GetVictim(), HATEFUL_THREAT_AMT); + AddThreat(currentVictim, HATEFUL_THREAT_AMT); if (secondThreat) secondThreat->AddThreat(HATEFUL_THREAT_AMT); if (thirdThreat) diff --git a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp index 2dbcaa7af95..a2cb29d53c8 100644 --- a/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp +++ b/src/server/scripts/Northrend/Nexus/EyeOfEternity/boss_malygos.cpp @@ -1831,7 +1831,7 @@ class spell_malygos_vortex_visual : public SpellScriptLoader { if (Creature* caster = GetCaster()->ToCreature()) { - for (ThreatReference* ref : caster->GetThreatManager().GetUnsortedThreatList()) + for (ThreatReference const* ref : caster->GetThreatManager().GetUnsortedThreatList()) { if (Player* targetPlayer = ref->GetVictim()->ToPlayer()) { |
