From a7d0251b7711a798103c35296e2407a3fb5c9c76 Mon Sep 17 00:00:00 2001 From: Akkadius Date: Mon, 16 Oct 2017 13:15:03 -0500 Subject: [PATCH] Mob::TryFadeEffect sanity checks for potential crashing --- zone/mob.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/zone/mob.cpp b/zone/mob.cpp index efb2922f0..d08804410 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -3949,10 +3949,17 @@ int16 Mob::GetHealRate(uint16 spell_id, Mob* caster) { bool Mob::TryFadeEffect(int slot) { + if (!buffs[slot].spellid) + return false; + if(IsValidSpell(buffs[slot].spellid)) { for(int i = 0; i < EFFECT_COUNT; i++) { + + if (!spells[buffs[slot].spellid].effectid[i]) + continue; + if (spells[buffs[slot].spellid].effectid[i] == SE_CastOnFadeEffectAlways || spells[buffs[slot].spellid].effectid[i] == SE_CastOnRuneFadeEffect) {