diff options
author | Treeston <treeston.mmoc@gmail.com> | 2018-01-21 02:14:17 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2021-06-16 14:29:45 +0200 |
commit | 73bf0e3a0b1f93d8dab719194b4aa5bf746cb969 (patch) | |
tree | 8883df6891ceb4dc6f3bd7f6d7cc76414af4dbc4 /src | |
parent | 9f91cf23ab8ab5f4fe35cba2e504d299248c4e60 (diff) |
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.)
(cherry picked from commit 013d4560c784b1deced9cd2ea11606eaf6b44f2d)
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/Combat/ThreatManager.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp index c24529c7d9d..355cb225105 100644 --- a/src/server/game/Combat/ThreatManager.cpp +++ b/src/server/game/Combat/ThreatManager.cpp @@ -615,8 +615,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() |