mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-04 11:02:42 +00:00
Merge pull request #61 from Valorith/copilot/sub-pr-60
Fix: skip suppressed slots in DispelMagic to prevent crash and incorrect buff restoration
This commit is contained in:
commit
522b0c77be
@ -7536,19 +7536,21 @@ void Mob::DispelMagic(Mob* caster, uint16 spell_id, int effect_value, int chance
|
||||
|
||||
for (int slot = 0; slot < GetMaxTotalSlots(); ++slot) {
|
||||
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 (!IsValidSpell(dispel_spell_id) || spells[dispel_spell_id].dispel_flag != 0 || IsDiscipline(dispel_spell_id)) {
|
||||
// Suppressed buffs always return when suppression ends; they cannot be dispelled.
|
||||
if (s == SPELL_SUPPRESSED) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (detrimental_only && !IsDetrimentalSpell(dispel_spell_id)) {
|
||||
if (!IsValidSpell(s) || spells[s].dispel_flag != 0 || IsDiscipline(s)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (beneficial_only && IsDetrimentalSpell(dispel_spell_id)) {
|
||||
if (detrimental_only && !IsDetrimentalSpell(s)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (beneficial_only && IsDetrimentalSpell(s)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -7570,7 +7572,7 @@ void Mob::DispelMagic(Mob* caster, uint16 spell_id, int effect_value, int chance
|
||||
break;
|
||||
} else {
|
||||
//Additional restrictions on which buffs can be suppressed
|
||||
if (spells[dispel_spell_id].short_buff_box) {
|
||||
if (spells[s].short_buff_box) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user