mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-05 12:02:25 +00:00
Fix suppressed dispel crash in DispelMagic
This commit is contained in:
parent
db4f3d141d
commit
3f7e980cd5
@ -7536,16 +7536,19 @@ 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;
|
||||||
|
// Suppressed slots store a sentinel in spellid, so use the underlying spell
|
||||||
|
// for any lookup into the spell data table.
|
||||||
|
auto dispel_spell_id = s == SPELL_SUPPRESSED ? buffs[slot].suppressedid : s;
|
||||||
|
|
||||||
if (s == SPELL_UNKNOWN || spells[s].dispel_flag != 0 || IsDiscipline(s)) {
|
if (!IsValidSpell(dispel_spell_id) || spells[dispel_spell_id].dispel_flag != 0 || IsDiscipline(dispel_spell_id)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (detrimental_only && !IsDetrimentalSpell(s)) {
|
if (detrimental_only && !IsDetrimentalSpell(dispel_spell_id)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (beneficial_only && IsDetrimentalSpell(s)) {
|
if (beneficial_only && IsDetrimentalSpell(dispel_spell_id)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7567,7 +7570,7 @@ void Mob::DispelMagic(Mob* caster, uint16 spell_id, int effect_value, int chance
|
|||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
//Additional restrictions on which buffs can be suppressed
|
//Additional restrictions on which buffs can be suppressed
|
||||||
if (spells[s].short_buff_box) {
|
if (spells[dispel_spell_id].short_buff_box) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user