Skip effect removal loop for SPELL_SUPPRESSED in BuffFadeBySlot

When BuffFadeBySlot() is called on a suppressed slot (e.g., when
suppression timer expires), the effect removal loop accesses
spells[SPELL_SUPPRESSED] (index 0xFFFD) which is out-of-bounds.
This is unnecessary since effects were already removed when the buff
was first suppressed. Skip the loop entirely for SPELL_SUPPRESSED
slots to prevent OOB memory access and let execution proceed directly
to the restoration branch.

Fixes #29
This commit is contained in:
Vayle 2026-01-31 02:29:11 +00:00
parent b3c40242f0
commit f6ab4cd377

View File

@ -4268,6 +4268,9 @@ void Mob::BuffFadeBySlot(int slot, bool iRecalcBonuses, bool suppress, uint32 su
}
}
// Skip effect removal for suppressed slots — effects were already removed
// during initial suppression, and accessing spells[SPELL_SUPPRESSED] would be OOB.
if (buffs[slot].spellid != SPELL_SUPPRESSED)
for (int i=0; i < EFFECT_COUNT; i++)
{
if(IsBlankSpellEffect(buffs[slot].spellid, i))