From 88e18898e24d17a846633978d1136d408da1a6e8 Mon Sep 17 00:00:00 2001 From: kid10 Date: Tue, 21 Aug 2012 15:43:40 +0200 Subject: [PATCH] [12108] Add RemoveSpellsCausingAura to remove auras of type and caster --- src/game/Unit.cpp | 14 ++++++++++++++ src/game/Unit.h | 1 + src/shared/revision_nr.h | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 96bc17acb..47b859643 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -778,6 +778,20 @@ void Unit::RemoveSpellsCausingAura(AuraType auraType, SpellAuraHolder* except) } } +void Unit::RemoveSpellsCausingAura(AuraType auraType, ObjectGuid casterGuid) +{ + for (AuraList::const_iterator iter = m_modAuras[auraType].begin(); iter != m_modAuras[auraType].end();) + { + if ((*iter)->GetCasterGuid() == casterGuid) + { + RemoveAuraHolderFromStack((*iter)->GetId(), 1, casterGuid); + iter = m_modAuras[auraType].begin(); + } + else + ++iter; + } +} + void Unit::DealDamageMods(Unit* pVictim, uint32& damage, uint32* absorb) { if (!pVictim->isAlive() || pVictim->IsTaxiFlying() || (pVictim->GetTypeId() == TYPEID_UNIT && ((Creature*)pVictim)->IsInEvadeMode())) diff --git a/src/game/Unit.h b/src/game/Unit.h index 645124150..98ffedcb9 100644 --- a/src/game/Unit.h +++ b/src/game/Unit.h @@ -1575,6 +1575,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject void RemoveAurasAtMechanicImmunity(uint32 mechMask, uint32 exceptSpellId, bool non_positive = false); void RemoveSpellsCausingAura(AuraType auraType); void RemoveSpellsCausingAura(AuraType auraType, SpellAuraHolder* except); + void RemoveSpellsCausingAura(AuraType auraType, ObjectGuid casterGuid); void RemoveRankAurasDueToSpell(uint32 spellId); bool RemoveNoStackAurasDueToAuraHolder(SpellAuraHolder* holder); void RemoveAurasWithInterruptFlags(uint32 flags); diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index f1538d6c5..dfe44f40a 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ -#define REVISION_NR "0152" + #define REVISION_NR "12108" #endif // __REVISION_NR_H__