Core/Aura: Replace assert with logged error for invalid AuraRemoveMode

Fix AuraScript::Remove() triggering an assert with default parameter and log an error when Aura is removed with invalid mode AURA_REMOVE_NONE instead of triggering an assert deep down in the call tree.
Fix https://github.com/TrinityCore/TrinityCore/issues/714 , triggered by spell 50240 "Evasive Maneuvers" script
This commit is contained in:
jackpoz committed 2015-01-07 22:48:34 +01:00
1 parent 253dc0f99e
commit 9ea93eae33
3 files changed
+9 -3

No files matched your search

+6
View File
@@ -3587,6 +3587,12 @@ void Unit::RemoveOwnedAura(Aura* aura, AuraRemoveMode removeMode)
ASSERT(aura->GetOwner() == this);
if (removeMode == AURA_REMOVE_NONE)
{
TC_LOG_ERROR("spells", "Unit::RemoveOwnedAura() called with unallowed removeMode AURA_REMOVE_NONE, spellId %u", aura->GetId());
return;
}
uint32 spellId = aura->GetId();
AuraMapBoundsNonConst range = m_ownedAuras.equal_range(spellId);