Skip to content

Commit

Permalink
Spells: Ensure that SpellMods have the right No. of charges
Browse files Browse the repository at this point in the history
  • Loading branch information
insunaa committed Jan 29, 2024
1 parent 41f79bb commit 83b8897
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/game/Spells/SpellAuras.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Player*>(GetTarget())->AddSpellMod(m_spellmod, apply);
Expand Down Expand Up @@ -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;
Expand All @@ -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())
Expand Down

0 comments on commit 83b8897

Please sign in to comment.