diff options
author | megamage <none@none> | 2009-01-16 22:59:24 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-01-16 22:59:24 -0600 |
commit | fa2e6622ad9dca5051b451e14ea303670ec65fa6 (patch) | |
tree | 585a7216408a60c43037244c96b2be7bceffa568 /src/game/ThreatManager.cpp | |
parent | 11239e9f5f9bf63e1ec07bb348b054accebd5b56 (diff) | |
parent | 0a1c601a1cc0e0036ad8fbfce68d87d14fa572d0 (diff) |
*Merge.
--HG--
branch : trunk
Diffstat (limited to 'src/game/ThreatManager.cpp')
-rw-r--r-- | src/game/ThreatManager.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/game/ThreatManager.cpp b/src/game/ThreatManager.cpp index 1af12bedc02..a78dfc09373 100644 --- a/src/game/ThreatManager.cpp +++ b/src/game/ThreatManager.cpp @@ -372,10 +372,15 @@ void ThreatManager::addThreat(Unit* pVictim, float pThreat, SpellSchoolMask scho { float reducedThreat = threat * pVictim->GetReducedThreatPercent() / 100; threat -= reducedThreat; - if(pVictim->GetMisdirectionTarget()) - iThreatContainer.addThreat(pVictim->GetMisdirectionTarget(), reducedThreat); + if(Unit *unit = pVictim->GetMisdirectionTarget()) + _addThreat(unit, reducedThreat); } + _addThreat(pVictim, threat); +} + +void ThreatManager::_addThreat(Unit *pVictim, float threat) +{ HostilReference* ref = iThreatContainer.addThreat(pVictim, threat); // Ref is not in the online refs, search the offline refs next if(!ref) |