aboutsummaryrefslogtreecommitdiff
path: root/src/game/ThreatManager.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2008-12-17 20:07:25 -0600
committermegamage <none@none>2008-12-17 20:07:25 -0600
commitac5bf63acdea0f1bc10700e6735cbcb8caf5def2 (patch)
tree9cebb0b5a6b8cbfda41fbacd74472e25f71ac378 /src/game/ThreatManager.cpp
parent5244d4986ae44253fe3240740d81e0c68fe9c37a (diff)
*Fix misdirection.
--HG-- branch : trunk
Diffstat (limited to 'src/game/ThreatManager.cpp')
-rw-r--r--src/game/ThreatManager.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/game/ThreatManager.cpp b/src/game/ThreatManager.cpp
index 05d8c70da60..b9711b8a2e7 100644
--- a/src/game/ThreatManager.cpp
+++ b/src/game/ThreatManager.cpp
@@ -357,6 +357,14 @@ void ThreatManager::addThreat(Unit* pVictim, float pThreat, SpellSchoolMask scho
float threat = ThreatCalcHelper::calcThreat(pVictim, iOwner, pThreat, schoolMask, pThreatSpell);
+ if(pVictim->GetReducedThreatPercent())
+ {
+ float reducedThreat = threat * pVictim->GetReducedThreatPercent() / 100;
+ threat -= reducedThreat;
+ if(pVictim->GetMisdirectionTarget())
+ iThreatContainer.addThreat(pVictim->GetMisdirectionTarget(), reducedThreat);
+ }
+
HostilReference* ref = iThreatContainer.addThreat(pVictim, threat);
// Ref is not in the online refs, search the offline refs next
if(!ref)