*Fix misdirection.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-01-16 18:49:41 -06:00
parent a8e7fb1649
commit 6a66df09eb
2 changed files with 9 additions and 2 deletions
+7 -2
View File
@@ -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)
+2
View File
@@ -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);