aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormegamage <none@none>2009-01-16 18:49:41 -0600
committermegamage <none@none>2009-01-16 18:49:41 -0600
commit6a66df09ebb158de53c947b1f4aa827ba2a942d0 (patch)
tree9625413505d5792cc1a574af482ea6398bc584fc
parenta8e7fb16493c05a25044c01c5b58ea08e485a97a (diff)
*Fix misdirection.
--HG-- branch : trunk
-rw-r--r--src/game/ThreatManager.cpp9
-rw-r--r--src/game/ThreatManager.h2
2 files changed, 9 insertions, 2 deletions
diff --git a/src/game/ThreatManager.cpp b/src/game/ThreatManager.cpp
index 58423794154..0e902c05864 100644
--- a/src/game/ThreatManager.cpp
+++ b/src/game/ThreatManager.cpp
@@ -361,10 +361,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)
diff --git a/src/game/ThreatManager.h b/src/game/ThreatManager.h
index 1cecee3a4be..d4a3910e91e 100644
--- a/src/game/ThreatManager.h
+++ b/src/game/ThreatManager.h
@@ -175,6 +175,8 @@ class TRINITY_DLL_SPEC ThreatManager
Unit* iOwner;
ThreatContainer iThreatContainer;
ThreatContainer iThreatOfflineContainer;
+
+ void _addThreat(Unit* target, float threat);
public:
explicit ThreatManager(Unit *pOwner);