diff options
author | megamage <none@none> | 2009-01-17 14:11:22 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-01-17 14:11:22 -0600 |
commit | ff3157eeb3802e06183edb23c2842d152bf79662 (patch) | |
tree | da286b01cbb940dcbabd7e0885b8a64c8b8c9b78 | |
parent | 8f22b65443e12de4be9a9d994f3240129331c36d (diff) |
*Do not trigger linked spells when aura is removed by stack.
--HG--
branch : trunk
-rw-r--r-- | src/game/Unit.cpp | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 6a3efdf266f..6d2eb1ec4cc 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -4655,18 +4655,7 @@ void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode) } } - if(const std::vector<int32> *spell_triggered = spellmgr.GetSpellLinked(-(int32)Aur->GetSpellProto()->Id)) - { - for(std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr) - { - if(spell_triggered < 0) - RemoveAurasDueToSpell(-(*itr)); - else if(Unit* caster = Aur->GetCaster()) - CastSpell(this, *itr, true, 0, 0, caster->GetGUID()); - } - } - - sLog.outDebug("Aura %u now is remove mode %d",Aur->GetModifier()->m_auraname, mode); + sLog.outDebug("Aura %u (%u) now is remove mode %d", Aur->GetId(), Aur->GetModifier()->m_auraname, mode); assert(!Aur->IsInUse()); Aur->ApplyModifier(false,true); @@ -4681,6 +4670,20 @@ void Unit::RemoveAura(AuraMap::iterator &i, AuraRemoveMode mode) if(statue) statue->UnSummon(); + if(mode != AURA_REMOVE_BY_STACK) + { + if(const std::vector<int32> *spell_triggered = spellmgr.GetSpellLinked(-(int32)Aur->GetSpellProto()->Id)) + { + for(std::vector<int32>::const_iterator itr = spell_triggered->begin(); itr != spell_triggered->end(); ++itr) + { + if(spell_triggered < 0) + RemoveAurasDueToSpell(-(*itr)); + else if(Unit* caster = Aur->GetCaster()) + CastSpell(this, *itr, true, 0, 0, caster->GetGUID()); + } + } + } + // only way correctly remove all auras from list if( m_Auras.empty() ) i = m_Auras.end(); |