fix(Core/Spells): revert CAST proc ordering and add ApplySpellMod recursion guard (#24990)

Co-authored-by: blinkysc <blinkysc@users.noreply.github.com>
This commit is contained in:
blinkysc
2026-03-03 16:45:06 -06:00
committed by GitHub
parent a013968436
commit cccd52dab8
8 changed files with 36 additions and 390 deletions

View File

@@ -820,6 +820,17 @@ void AuraEffect::ApplySpellMod(Unit* target, bool apply)
// Auras with charges do not mod amount of passive auras
if (GetBase()->IsUsingCharges())
return;
// Guard against infinite recursion: a spell mod recalculating an aura that
// triggers ApplySpellMod again (self-referencing or mutual spell mods).
if (m_isRecalculatingPassiveAuras)
{
LOG_DEBUG("spells.aura", "AuraEffect::ApplySpellMod: Recursion detected for spell {} effect {}, skipping passive aura recalculation",
GetId(), GetEffIndex());
return;
}
m_isRecalculatingPassiveAuras = true;
// reapply some passive spells after add/remove related spellmods
// Warning: it is a dead loop if 2 auras each other amount-shouldn't happen
switch (GetMiscValue())
@@ -906,6 +917,8 @@ void AuraEffect::ApplySpellMod(Unit* target, bool apply)
default:
break;
}
m_isRecalculatingPassiveAuras = false;
}
void AuraEffect::Update(uint32 diff, Unit* caster)