diff options
author | megamage <none@none> | 2009-03-24 17:16:28 -0600 |
---|---|---|
committer | megamage <none@none> | 2009-03-24 17:16:28 -0600 |
commit | 4cee45c09d84c0ffefd79c2ecdc74f5763f35947 (patch) | |
tree | 0409297588b2f00d79f8c37abcde2ecc32e84cdb | |
parent | 40598d6647d9d42d2d468889a25622b4aef83666 (diff) |
*Set interrupt aura with remove cancel.
--HG--
branch : trunk
-rw-r--r-- | src/game/Unit.cpp | 14 | ||||
-rw-r--r-- | src/game/Unit.h | 3 |
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); |