diff options
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r-- | src/game/Unit.cpp | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 3c2713c6d91..e7b31aa5546 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -572,7 +572,7 @@ void Unit::RemoveAurasWithInterruptFlags(uint32 flag, uint32 except) sLog.outError("Aura %u is trying to remove itself! Flag %u. May cause crash!", (*iter)->GetId(), flag); else if(!except || (*iter)->GetId() != except) { - RemoveAurasDueToSpell((*iter)->GetId()); + RemoveAurasBySpell((*iter)->GetId(), AURA_REMOVE_BY_CANCEL); if (!m_interruptableAuras.empty()) next = m_interruptableAuras.begin(); else @@ -3843,7 +3843,7 @@ bool Unit::AddAura(Aura *Aur) if(Aur->GetStackAmount() < aurSpellInfo->StackAmount) Aur->InitStackAmount(Aur->GetStackAmount()+1); } - RemoveAura(i2,AURA_REMOVE_BY_STACK); + RemoveAura(i2,AURA_REMOVE_BY_DELETE); i2=m_Auras.lower_bound(spair); continue; } @@ -3863,7 +3863,7 @@ bool Unit::AddAura(Aura *Aur) ++i2; continue; } - RemoveAura(i2,AURA_REMOVE_BY_STACK); + RemoveAura(i2,AURA_REMOVE_BY_DELETE); i2=m_Auras.lower_bound(spair); continue; } @@ -3901,7 +3901,7 @@ bool Unit::AddAura(Aura *Aur) sLog.outError("Aura (Spell %u Effect %u) is in process but attempt removed at aura (Spell %u Effect %u) adding, need add stack rule for IsSingleTargetSpell", (*itr)->GetId(), (*itr)->GetEffIndex(),Aur->GetId(), Aur->GetEffIndex()); continue; } - (*itr)->GetTarget()->RemoveAurasByCasterSpell((*itr)->GetId(),(*itr)->GetEffIndex(), caster->GetGUID(), AURA_REMOVE_BY_STACK); + (*itr)->GetTarget()->RemoveAurasByCasterSpell((*itr)->GetId(),(*itr)->GetEffIndex(), caster->GetGUID(), AURA_REMOVE_BY_DELETE); restart = true; break; } @@ -3964,7 +3964,7 @@ void Unit::RemoveRankAurasDueToSpell(uint32 spellId) { if(iter->second->GetCasterGUID()==(*i).second->GetCasterGUID()) { - RemoveAura(iter, AURA_REMOVE_BY_STACK); + RemoveAura(iter, AURA_REMOVE_BY_DELETE); iter = m_Auras.lower_bound(spair); } else @@ -4090,7 +4090,7 @@ bool Unit::RemoveNoStackAurasDueToAura(Aura *Aur) { if(iter->second->GetCasterGUID()==caster) { - RemoveAura(iter, AURA_REMOVE_BY_STACK); + RemoveAura(iter, AURA_REMOVE_BY_DELETE); iter = m_Auras.lower_bound(spair); } else @@ -4121,6 +4121,18 @@ void Unit::RemoveAura(uint32 spellId, uint32 effindex, Aura* except) } } +void Unit::RemoveAurasBySpell(uint32 spellId, AuraRemoveMode removeMode) +{ + for (AuraMap::iterator iter = m_Auras.begin(); iter != m_Auras.end(); ) + { + Aura *aur = iter->second; + if (aur->GetId() == spellId) + RemoveAura(iter, removeMode); + else + ++iter; + } +} + void Unit::RemoveAurasByCasterSpell(uint32 spellId, uint64 casterGUID, AuraRemoveMode removeMode) { for (AuraMap::iterator iter = m_Auras.begin(); iter != m_Auras.end(); ) @@ -4259,17 +4271,6 @@ void Unit::RemoveAurasDueToSpellBySteal(uint32 spellId, uint64 casterGUID, Unit } } -void Unit::RemoveAurasDueToSpellByCancel(uint32 spellId) -{ - for (AuraMap::iterator iter = m_Auras.begin(); iter != m_Auras.end(); ) - { - if (iter->second->GetId() == spellId) - RemoveAura(iter, AURA_REMOVE_BY_CANCEL); - else - ++iter; - } -} - void Unit::RemoveAurasWithDispelType( DispelType type ) { // Create dispel mask by dispel type @@ -4336,7 +4337,7 @@ void Unit::RemoveNotOwnSingleTargetAuras() for (AuraMap::iterator iter = m_Auras.begin(); iter != m_Auras.end(); ) { if (iter->second->GetCasterGUID()!=GetGUID() && IsSingleTargetSpell(iter->second->GetSpellProto())) - RemoveAura(iter, AURA_REMOVE_BY_STACK); + RemoveAura(iter, AURA_REMOVE_BY_DELETE); else ++iter; } |