aboutsummaryrefslogtreecommitdiff
path: root/src/game/Unit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Unit.cpp')
-rw-r--r--src/game/Unit.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index bbb7ffb9fb4..d0bd170b931 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -476,6 +476,28 @@ void Unit::RemoveSpellsCausingAura(AuraType auraType)
}
}
+void Unit::RemoveSpellsCausingAuraWithDispel(AuraType auraType, Spell * spell)
+{
+ if (auraType >= TOTAL_AURAS) return;
+ AuraList::iterator iter, next;
+ for (iter = m_modAuras[auraType].begin(); iter != m_modAuras[auraType].end(); iter = next)
+ {
+ next = iter;
+ ++next;
+
+ if (*iter)
+ {
+ if (!(*iter)->GetDispelChance(spell))
+ continue;
+ RemoveAurasDueToSpell((*iter)->GetId());
+ if (!m_modAuras[auraType].empty())
+ next = m_modAuras[auraType].begin();
+ else
+ return;
+ }
+ }
+}
+
void Unit::RemoveAurasWithInterruptFlags(uint32 flag, uint32 except)
{
if(!(m_interruptMask & flag))