Skip DoBuffTic() for SPELL_SUPPRESSED buff slots

BuffProcess() calls DoBuffTic() on all valid-or-suppressed spells, but
DoBuffTic() accesses spells[buff.spellid] which for SPELL_SUPPRESSED
(0xFFFD) could read out-of-bounds memory. Add an explicit check to skip
DoBuffTic() for suppressed slots since they should only have their timer
decremented, not their effects ticked.

Fixes #30
This commit is contained in:
Vayle 2026-01-31 02:26:56 +00:00
parent b3c40242f0
commit 0362cacf99

View File

@ -3812,7 +3812,9 @@ void Mob::BuffProcess()
{
if (IsValidOrSuppressedSpell(buffs[buffs_i].spellid))
{
DoBuffTic(buffs[buffs_i], buffs_i, entity_list.GetMob(buffs[buffs_i].casterid));
if (buffs[buffs_i].spellid != SPELL_SUPPRESSED) {
DoBuffTic(buffs[buffs_i], buffs_i, entity_list.GetMob(buffs[buffs_i].casterid));
}
// If the Mob died during DoBuffTic, then the buff we are currently processing will have been removed
if(!IsValidOrSuppressedSpell(buffs[buffs_i].spellid)) {
continue;