@@ -48,25 +48,8 @@ float ThreatCalcHelper::CalcThreat(Unit* hatedUnit, Unit* hatingUnit, float thre
48
48
49
49
if (threatSpell)
50
50
{
51
- // Keep exception to calculate the real threat for SPELL_AURA_MOD_TOTAL_THREAT
52
- bool HasExceptionForNoThreat = false ;
53
- for (int i = 0 ; i < MAX_EFFECT_INDEX; i++)
54
- {
55
- if (threatSpell->EffectApplyAuraName [i] == SPELL_AURA_MOD_TOTAL_THREAT && threatSpell->EffectBasePoints [i] < 0 )
56
- {
57
- HasExceptionForNoThreat = true ;
58
- break ;
59
- }
60
- }
61
-
62
- if (!HasExceptionForNoThreat)
63
- {
64
- if (threatSpell->HasAttribute (SPELL_ATTR_EX_NO_THREAT))
65
- return 0 .0f ;
66
-
67
- if (Player* modOwner = hatedUnit->GetSpellModOwner ())
68
- modOwner->ApplySpellMod (threatSpell->Id , SPELLMOD_THREAT, threat);
69
- }
51
+ if (Player* modOwner = hatedUnit->GetSpellModOwner ())
52
+ modOwner->ApplySpellMod (threatSpell->Id , SPELLMOD_THREAT, threat);
70
53
71
54
if (crit)
72
55
threat *= hatedUnit->GetTotalAuraMultiplierByMiscMask (SPELL_AURA_MOD_CRITICAL_THREAT, schoolMask);
@@ -502,7 +485,7 @@ void ThreatManager::addThreat(Unit* victim, float threat, bool crit, SpellSchool
502
485
{
503
486
float redirectedThreat = threat * redirectedMod;
504
487
totalMod += redirectedMod;
505
- addThreatDirectly (redirectedTarget, redirectedThreat);
488
+ addThreatDirectly (redirectedTarget, redirectedThreat, false );
506
489
}
507
490
}
508
491
if (totalMod != 0 .f )
@@ -512,10 +495,10 @@ void ThreatManager::addThreat(Unit* victim, float threat, bool crit, SpellSchool
512
495
}
513
496
}
514
497
515
- addThreatDirectly (victim, calculatedThreat);
498
+ addThreatDirectly (victim, calculatedThreat, threatSpell && threatSpell-> HasAttribute (SPELL_ATTR_EX_NO_THREAT) );
516
499
}
517
500
518
- void ThreatManager::addThreatDirectly (Unit* victim, float threat)
501
+ void ThreatManager::addThreatDirectly (Unit* victim, float threat, bool noNew )
519
502
{
520
503
HostileReference* ref = iThreatContainer.addThreat (victim, threat);
521
504
// Ref is online
@@ -525,7 +508,7 @@ void ThreatManager::addThreatDirectly(Unit* victim, float threat)
525
508
else
526
509
ref = iThreatOfflineContainer.addThreat (victim, threat);
527
510
528
- if (!ref) // there was no ref => create a new one
511
+ if (!ref && !noNew) // there was no ref => create a new one
529
512
{
530
513
HostileReference* hostileReference = new HostileReference (victim, this , 0 ); // threat has to be 0 here
531
514
iThreatContainer.addReference (hostileReference);
0 commit comments