Core/Auras: Fixed iterator invalidation crash with procs using SPELL_ATTR0_PROC_FAILURE_BURNS_CHARGE attribute

This commit is contained in:
Shauren authored and Ovahlord committed 2025-08-03 14:11:56 +02:00
1 parent 744aa1fd96
commit b13703f1ea
2 files changed
+14 -11

No files matched your search

+1 -1
View File
@@ -9863,7 +9863,7 @@ void Unit::GetProcAurasTriggeredOnEvent(AuraApplicationProcContainer& aurasTrigg
if (SpellProcEntry const* procEntry = sSpellMgr->GetSpellProcEntry(aurApp->GetBase()->GetSpellInfo()->Id))
{
aurApp->GetBase()->PrepareProcChargeDrop(procEntry, eventInfo);
aurApp->GetBase()->ConsumeProcCharges(procEntry);
aurasTriggeringProc.emplace_back(0, aurApp);
}
}
+13 -10
View File
@@ -1979,20 +1979,23 @@ float Aura::CalcProcChance(SpellProcEntry const& procEntry, ProcEventInfo& event
void Aura::TriggerProcOnEvent(uint8 procEffectMask, AuraApplication* aurApp, ProcEventInfo& eventInfo)
{
bool prevented = CallScriptProcHandlers(aurApp, eventInfo);
if (!prevented)
if (procEffectMask)
{
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
bool prevented = CallScriptProcHandlers(aurApp, eventInfo);
if (!prevented)
{
if (!(procEffectMask & (1 << i)))
continue;
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
if (!(procEffectMask & (1 << i)))
continue;
// OnEffectProc / AfterEffectProc hooks handled in AuraEffect::HandleProc()
if (aurApp->HasEffect(i))
GetEffect(i)->HandleProc(aurApp, eventInfo);
// OnEffectProc / AfterEffectProc hooks handled in AuraEffect::HandleProc()
if (aurApp->HasEffect(i))
GetEffect(i)->HandleProc(aurApp, eventInfo);
}
CallScriptAfterProcHandlers(aurApp, eventInfo);
}
CallScriptAfterProcHandlers(aurApp, eventInfo);
}
ConsumeProcCharges(ASSERT_NOTNULL(sSpellMgr->GetSpellProcEntry(GetSpellInfo()->Id)));