From 84bb8a8efe0d04e2734e066fb25d91652d4ea7c8 Mon Sep 17 00:00:00 2001 From: Treeston Date: Sun, 21 Jan 2018 02:14:17 +0100 Subject: [PATCH] Core/Threat: Assistance threat (healing, buffs, etc.) is now properly split (instead of copied) between all creatures threatened by the action. Thanks to Foereaper for help with testing, and my apologies to healers everywhere. (No apologies for charm AI though. You deserve that one.) --- src/server/game/Combat/ThreatManager.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp index 90422e9b7df..0e6d57041af 100644 --- a/src/server/game/Combat/ThreatManager.cpp +++ b/src/server/game/Combat/ThreatManager.cpp @@ -608,8 +608,11 @@ void ThreatManager::ForwardThreatForAssistingMe(Unit* assistant, float baseAmoun { if (spell && spell->HasAttribute(SPELL_ATTR1_NO_THREAT)) // shortcut, none of the calls would do anything return; + if (_threatenedByMe.empty()) + return; + float const perTarget = baseAmount / _threatenedByMe.size(); // Threat is divided evenly among all targets (LibThreat sourced) for (auto const& pair : _threatenedByMe) - pair.second->GetOwner()->GetThreatManager().AddThreat(assistant, baseAmount, spell, ignoreModifiers); + pair.second->GetOwner()->GetThreatManager().AddThreat(assistant, perTarget, spell, ignoreModifiers); } void ThreatManager::RemoveMeFromThreatLists()