diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 59595941f..dab83c56f 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -3789,15 +3789,15 @@ void Aura::HandleAuraModSilence(bool apply, bool Real) void Aura::HandleModThreat(bool apply, bool Real) { // only at real add/remove aura - if(!Real) + if (!Real) return; - if(!m_target->isAlive()) + if (!m_target->isAlive()) return; Unit* caster = GetCaster(); - if(!caster || !caster->isAlive()) + if (!caster || !caster->isAlive()) return; int level_diff = 0; @@ -3815,38 +3815,31 @@ void Aura::HandleModThreat(bool apply, bool Real) multiplier = 1; break; } + if (level_diff > 0) m_modifier.m_amount += multiplier * level_diff; - for(int8 x=0;x < MAX_SPELL_SCHOOL;x++) - { - if(m_modifier.m_miscvalue & int32(1<GetTypeId() == TYPEID_PLAYER) - ApplyPercentModFloatVar(m_target->m_threatModifier[x], m_positive ? m_modifier.m_amount : -m_modifier.m_amount, apply); - } - } + if (m_target->GetTypeId() == TYPEID_PLAYER) + for(int8 x=0;x < MAX_SPELL_SCHOOL;x++) + if (m_modifier.m_miscvalue & int32(1<m_threatModifier[x], m_modifier.m_amount, apply); } void Aura::HandleAuraModTotalThreat(bool apply, bool Real) { // only at real add/remove aura - if(!Real) + if (!Real) return; - if(!m_target->isAlive() || m_target->GetTypeId()!= TYPEID_PLAYER) + if (!m_target->isAlive() || m_target->GetTypeId() != TYPEID_PLAYER) return; Unit* caster = GetCaster(); - if(!caster || !caster->isAlive()) + if (!caster || !caster->isAlive()) return; - float threatMod = 0.0f; - if(apply) - threatMod = float(m_modifier.m_amount); - else - threatMod = float(-m_modifier.m_amount); + float threatMod = apply ? float(m_modifier.m_amount) : float(-m_modifier.m_amount); m_target->getHostilRefManager().threatAssist(caster, threatMod); } @@ -3854,18 +3847,18 @@ void Aura::HandleAuraModTotalThreat(bool apply, bool Real) void Aura::HandleModTaunt(bool apply, bool Real) { // only at real add/remove aura - if(!Real) + if (!Real) return; - if(!m_target->isAlive() || !m_target->CanHaveThreatList()) + if (!m_target->isAlive() || !m_target->CanHaveThreatList()) return; Unit* caster = GetCaster(); - if(!caster || !caster->isAlive()) + if (!caster || !caster->isAlive()) return; - if(apply) + if (apply) m_target->TauntApply(caster); else { diff --git a/src/game/ThreatManager.cpp b/src/game/ThreatManager.cpp index 9a1ad7e8f..a058a8fc7 100644 --- a/src/game/ThreatManager.cpp +++ b/src/game/ThreatManager.cpp @@ -32,11 +32,9 @@ // The pHatingUnit is not used yet float ThreatCalcHelper::calcThreat(Unit* pHatedUnit, Unit* pHatingUnit, float pThreat, SpellSchoolMask schoolMask, SpellEntry const *pThreatSpell) { - if(pThreatSpell) - { - if( Player* modOwner = pHatingUnit->GetSpellModOwner() ) + if (pThreatSpell) + if (Player* modOwner = pHatedUnit->GetSpellModOwner()) modOwner->ApplySpellMod(pThreatSpell->Id, SPELLMOD_THREAT, pThreat); - } float threat = pHatedUnit->ApplyTotalThreatModifier(pThreat, schoolMask); return threat; diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index e9a958e72..21e3feb40 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "8162" + #define REVISION_NR "8163" #endif // __REVISION_NR_H__