aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/SpellAuras.cpp10
-rw-r--r--src/game/Unit.cpp4
2 files changed, 10 insertions, 4 deletions
diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp
index 85caa4a047d..96738c22bfa 100644
--- a/src/game/SpellAuras.cpp
+++ b/src/game/SpellAuras.cpp
@@ -1008,10 +1008,12 @@ void Aura::_AddAura()
{
if(const std::vector<int32> *spell_triggered = spellmgr.GetSpellLinked(id + SPELL_LINK_AURA))
for(std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr)
+ {
if(*itr < 0)
m_target->ApplySpellImmune(id, IMMUNITY_ID, -(*itr), m_target);
else if(Unit* caster = GetCaster())
m_target->AddAura(*itr, m_target);
+ }
}
//*****************************************************
@@ -1144,20 +1146,24 @@ void Aura::_RemoveAura()
{
if(const std::vector<int32> *spell_triggered = spellmgr.GetSpellLinked(-(int32)id))
for(std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr)
+ {
if(*itr < 0)
m_target->RemoveAurasDueToSpell(-(*itr));
else if(Unit* caster = GetCaster())
if (m_removeMode==AURA_REMOVE_BY_EXPIRE)
m_target->CastSpell(m_target, *itr, true, 0, 0, caster->GetGUID());
+ }
}
if(spellmgr.GetSpellCustomAttr(id) & SPELL_ATTR_CU_LINK_AURA)
{
if(const std::vector<int32> *spell_triggered = spellmgr.GetSpellLinked(id + SPELL_LINK_AURA))
for(std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr)
+ {
if(*itr < 0)
m_target->ApplySpellImmune(id, IMMUNITY_ID, -(*itr), false);
else
m_target->RemoveAurasDueToSpell(*itr);
+ }
}
// Proc on aura remove (only spell flags for now)
@@ -4062,12 +4068,12 @@ void AuraEffect::HandleModStateImmunityMask(bool apply, bool Real)
if(apply && GetSpellProto()->AttributesEx & SPELL_ATTR_EX_DISPEL_AURAS_ON_IMMUNITY)
{
- for (std::list <AuraType>::iterator iter = immunity_list.begin(); iter != immunity_list.end();)
+ for (std::list <AuraType>::iterator iter = immunity_list.begin(); iter != immunity_list.end();++iter)
{
m_target->RemoveAurasByType(*iter);
}
}
- for (std::list <AuraType>::iterator iter = immunity_list.begin(); iter != immunity_list.end();)
+ for (std::list <AuraType>::iterator iter = immunity_list.begin(); iter != immunity_list.end();++iter)
{
m_target->ApplySpellImmune(GetId(),IMMUNITY_STATE,*iter,apply);
}
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 63cb8ac39f5..a54ca74dfc6 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -3813,7 +3813,7 @@ bool Unit::AddAura(Aura *Aur)
}
if((Aur->GetSpellProto()->Attributes & SPELL_ATTR_BREAKABLE_BY_DAMAGE
&& !Aur->IsAuraType(SPELL_AURA_MOD_POSSESS)) //only dummy aura is breakable
- || (Aur->GetSpellProto()->Mechanic==MECHANIC_KNOCKOUT && Aur->IsAuraType(SPELL_AURA_MOD_STUN)))
+ || ((GetAllSpellMechanicMask(Aur->GetSpellProto()) & 1<<MECHANIC_KNOCKOUT) && Aur->IsAuraType(SPELL_AURA_MOD_STUN)))
{
m_ccAuras.push_back(Aur);
}
@@ -4126,7 +4126,7 @@ void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode)
if((Aur->GetSpellProto()->Attributes & SPELL_ATTR_BREAKABLE_BY_DAMAGE
&& !Aur->IsAuraType(SPELL_AURA_MOD_POSSESS)) //only dummy aura is breakable
- || (Aur->GetSpellProto()->Mechanic==MECHANIC_KNOCKOUT && Aur->IsAuraType(SPELL_AURA_MOD_STUN)))
+ || ((GetAllSpellMechanicMask(Aur->GetSpellProto()) & 1<<MECHANIC_KNOCKOUT) && Aur->IsAuraType(SPELL_AURA_MOD_STUN)))
{
m_ccAuras.remove(Aur);
}