From 83b8897e8307d56a6ff839e6c8bd592481fb5dd9 Mon Sep 17 00:00:00 2001 From: insunaa Date: Mon, 29 Jan 2024 14:06:59 +0100 Subject: [PATCH] Spells: Ensure that SpellMods have the right No. of charges --- src/game/Spells/SpellAuras.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/game/Spells/SpellAuras.cpp b/src/game/Spells/SpellAuras.cpp index 37cd5c6281d..654656bddb4 100755 --- a/src/game/Spells/SpellAuras.cpp +++ b/src/game/Spells/SpellAuras.cpp @@ -1107,7 +1107,7 @@ void Aura::HandleAddModifier(bool apply, bool Real) priority, // prevent expire spell mods with (charges > 0 && m_stackAmount > 1) // all this spell expected expire not at use but at spell proc event check - spellProto->StackAmount > 1 ? 0 : GetHolder()->GetAuraCharges()); + spellProto->StackAmount < 1 ? 0 : GetHolder()->GetAuraCharges()); } static_cast(GetTarget())->AddSpellMod(m_spellmod, apply); @@ -8374,6 +8374,7 @@ void SpellAuraHolder::SetAuraMaxDuration(int32 duration) void SpellAuraHolder::SetAuraCharges(uint32 charges, bool update) { + assert(GetId() != 16246); if (m_procCharges == charges) return; m_procCharges = charges; @@ -8394,6 +8395,9 @@ bool SpellAuraHolder::DropAuraCharge() --m_procCharges; + if (GetId() == 16246) + sLog.outError("DropAuraCharge Called!"); + for (uint8 i = 0; i < MAX_EFFECT_INDEX; i++) if (m_auras[i]) if (SpellModifier* spellMod = m_auras[i]->GetSpellModifier())