aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/Unit.cpp14
-rw-r--r--src/game/Unit.h3
2 files changed, 15 insertions, 2 deletions
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index f0472292027..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
@@ -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(); )
diff --git a/src/game/Unit.h b/src/game/Unit.h
index b735067909b..80547a7e237 100644
--- a/src/game/Unit.h
+++ b/src/game/Unit.h
@@ -1245,7 +1245,8 @@ class TRINITY_DLL_SPEC Unit : public WorldObject
void RemoveSingleAuraFromStack(uint32 spellId, uint32 effindex);
void RemoveAurasDueToSpell(uint32 spellId, Aura* except = NULL);
void RemoveAurasDueToItemSpell(Item* castItem,uint32 spellId);
- void RemoveAurasByCasterSpell(uint32 spellId, uint64 casterGUID, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT);
+ void RemoveAurasBySpell(uint32 spellId, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
+ void RemoveAurasByCasterSpell(uint32 spellId, uint64 casterGUID, AuraRemoveMode removeMode = AURA_REMOVE_BY_DEFAULT);
void RemoveAurasByCasterSpell(uint32 spellId, uint8 effindex, uint64 casterGUID, AuraRemoveMode removeMode=AURA_REMOVE_BY_DEFAULT);
void RefreshAurasByCasterSpell(uint32 spellId, uint64 casterGUID);
void SetAurasDurationByCasterSpell(uint32 spellId, uint64 casterGUID, int32 duration);