From b098c15674e4124cd5364ed70dc2731305a2a3e0 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 23 Dec 2010 19:58:00 +0100 Subject: Core/Auras: Removed pointless checks in SPELL_AURA_MOD_THREAT (10) --HG-- branch : trunk --- src/server/game/Spells/Auras/SpellAuraEffects.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'src/server') diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp index 55a0bc37790..9acb142f2d9 100755 --- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp +++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp @@ -3963,17 +3963,9 @@ void AuraEffect::HandleModThreat(AuraApplication const * aurApp, uint8 mode, boo return; Unit * target = aurApp->GetTarget(); - if (apply && !target->isAlive()) - return; - - Unit * caster = GetCaster(); - if (!caster) - return; - - if (target->GetTypeId() == TYPEID_PLAYER) - for (int8 x=0; x < MAX_SPELL_SCHOOL; x++) - if (GetMiscValue() & int32(1<m_threatModifier[x], (float)GetAmount(), apply); + for (int32 i = 0; i < MAX_SPELL_SCHOOL; ++i) + if (GetMiscValue() & (1 << i)) + ApplyPercentModFloatVar(target->m_threatModifier[i], float(GetAmount()), apply); } void AuraEffect::HandleAuraModTotalThreat(AuraApplication const * aurApp, uint8 mode, bool apply) const -- cgit v1.2.3