Merge pull request #60 from Valorith/codex/fix-dispelmagic-suppressed-crash

Fix crash when dispelling suppressed buffs
This commit is contained in:
Vayle
2026-03-08 20:57:06 -04:00
committed by GitHub
+6 -1
View File
@@ -7537,7 +7537,12 @@ void Mob::DispelMagic(Mob* caster, uint16 spell_id, int effect_value, int chance
for (int slot = 0; slot < GetMaxTotalSlots(); ++slot) { for (int slot = 0; slot < GetMaxTotalSlots(); ++slot) {
auto s = buffs[slot].spellid; auto s = buffs[slot].spellid;
if (s == SPELL_UNKNOWN || spells[s].dispel_flag != 0 || IsDiscipline(s)) { // Suppressed buffs always return when suppression ends; they cannot be dispelled.
if (s == SPELL_SUPPRESSED) {
continue;
}
if (!IsValidSpell(s) || spells[s].dispel_flag != 0 || IsDiscipline(s)) {
continue; continue;
} }