aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTreeston <treeston.mmoc@gmail.com>2018-01-21 02:14:17 +0100
committerTreeston <treeston.mmoc@gmail.com>2018-01-21 02:14:17 +0100
commit013d4560c784b1deced9cd2ea11606eaf6b44f2d (patch)
tree432cd4fa4cbdcb30f4abe9116150e649a73b2665 /src
parenta3732756121be6d5621fb42bc7a71882a28f03a6 (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.)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Combat/ThreatManager.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp
index 8c1e620a134..522fb917895 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()