[7875] Calculate mechanic immune mask for aura remove only if really needed.

Signed-off-by: ApoC <apoc@nymfe.net>
This commit is contained in:
ApoC 2009-05-22 19:05:28 +02:00
parent 5c80c62f9b
commit dad833fd3e
2 changed files with 7 additions and 7 deletions

View file

@ -3965,12 +3965,6 @@ void Aura::HandleAuraModUseNormalSpeed(bool /*apply*/, bool Real)
void Aura::HandleModMechanicImmunity(bool apply, bool /*Real*/)
{
uint32 mechanic = 1 << m_modifier.m_miscvalue;
//immune movement impairment and loss of control
if(GetId()==42292 || GetId()==59752)
mechanic=IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK;
// cache values in local vars for prevent access to possible deleted aura data
SpellEntry const* spellInfo = GetSpellProto();
uint32 misc = m_modifier.m_miscvalue;
@ -3978,6 +3972,12 @@ void Aura::HandleModMechanicImmunity(bool apply, bool /*Real*/)
if(apply && spellInfo->AttributesEx & SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY)
{
uint32 mechanic = 1 << m_modifier.m_miscvalue;
//immune movement impairment and loss of control
if(GetId()==42292 || GetId()==59752)
mechanic=IMMUNE_TO_MOVEMENT_IMPAIRMENT_AND_LOSS_CONTROL_MASK;
Unit::AuraMap& Auras = target->GetAuras();
for(Unit::AuraMap::iterator iter = Auras.begin(), next; iter != Auras.end(); iter = next)
{

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "7874"
#define REVISION_NR "7875"
#endif // __REVISION_NR_H__