aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Combat/ThreatManager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Combat/ThreatManager.cpp')
-rw-r--r--src/server/game/Combat/ThreatManager.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp
index bc1fe368316..1c18292a295 100644
--- a/src/server/game/Combat/ThreatManager.cpp
+++ b/src/server/game/Combat/ThreatManager.cpp
@@ -496,19 +496,19 @@ void ThreatManager::MatchUnitThreatToHighestThreat(Unit* target)
void ThreatManager::TauntUpdate()
{
- std::list<AuraEffect*> const& tauntEffects = _owner->GetAuraEffectsByType(SPELL_AURA_MOD_TAUNT);
+ Unit::AuraEffectList const& tauntEffects = _owner->GetAuraEffectsByType(SPELL_AURA_MOD_TAUNT);
- uint32 state = ThreatReference::TAUNT_STATE_TAUNT;
- std::unordered_map<ObjectGuid, ThreatReference::TauntState> tauntStates;
+ uint32 tauntPriority = 0; // lowest is highest
+ std::unordered_map<ObjectGuid, uint32> tauntStates;
// Only the last taunt effect applied by something still on our threat list is considered
- for (auto it = tauntEffects.begin(), end = tauntEffects.end(); it != end; ++it)
- tauntStates[(*it)->GetCasterGUID()] = ThreatReference::TauntState(state++);
+ for (AuraEffect const* tauntEffect : tauntEffects)
+ tauntStates[tauntEffect->GetCasterGUID()] = ++tauntPriority;
for (auto const& pair : _myThreatListEntries)
{
auto it = tauntStates.find(pair.first);
if (it != tauntStates.end())
- pair.second->UpdateTauntState(it->second);
+ pair.second->UpdateTauntState(ThreatReference::TauntState(ThreatReference::TAUNT_STATE_TAUNT + tauntStates.size() - it->second));
else
pair.second->UpdateTauntState();
}