diff options
author | QAston <none@none> | 2010-12-19 19:43:53 +0100 |
---|---|---|
committer | QAston <none@none> | 2010-12-19 19:43:53 +0100 |
commit | 251f7f212185cb83751551a71302b4a9d6519d65 (patch) | |
tree | 3ca6da06ca527a55b38dc18417b50f09ec5f03dc /src | |
parent | 60ce3fdbd2f0b3ca443e1810c328a186346a6d98 (diff) |
Core/Auras: Add some assertions to make sure that AuraEffects are not added twice to UnitAuraEffect containers.
--HG--
branch : trunk
Diffstat (limited to 'src')
-rwxr-xr-x | src/server/game/Spells/Auras/SpellAuras.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/server/game/Spells/Auras/SpellAuras.cpp b/src/server/game/Spells/Auras/SpellAuras.cpp index 01138aea7f3..fde83bfaced 100755 --- a/src/server/game/Spells/Auras/SpellAuras.cpp +++ b/src/server/game/Spells/Auras/SpellAuras.cpp @@ -147,6 +147,7 @@ void AuraApplication::_HandleEffect(uint8 effIndex, bool apply) if (apply) { + ASSERT(!(m_flags & (1<<effIndex))); m_flags |= 1<<effIndex; m_flags |=_CheckPositive(caster) ? AFLAG_POSITIVE : AFLAG_NEGATIVE; GetTarget()->_HandleAuraEffect(aurEff, true); @@ -154,6 +155,7 @@ void AuraApplication::_HandleEffect(uint8 effIndex, bool apply) } else { + ASSERT(m_flags & (1<<effIndex)); m_flags &= ~(1<<effIndex); m_flags |=_CheckPositive(caster) ? AFLAG_POSITIVE : AFLAG_NEGATIVE; @@ -423,17 +425,19 @@ void Aura::_UnapplyForTarget(Unit * target, Unit * caster, AuraApplication * aur ASSERT(auraApp); ApplicationMap::iterator itr = m_applications.find(target->GetGUID()); - // TODO: Figure out why this happens. + + // TODO: Figure out why this happens if (itr == m_applications.end()) { sLog.outError("Aura::_UnapplyForTarget, target:%u, caster:%u, spell:%u was not found in owners application map!", target->GetGUIDLow(), caster->GetGUIDLow(), auraApp->GetBase()->GetSpellProto()->Id); + ASSERT(false); } - else - m_applications.erase(itr); // aura has to be already applied - //ASSERT(itr->second == auraApp); + ASSERT(itr->second == auraApp); + m_applications.erase(itr); + m_removedApplications.push_back(auraApp); // reset cooldown state for spells |