diff --git a/zone/spells.cpp b/zone/spells.cpp index 6fe8afeed..aa2c4b2b4 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -2301,8 +2301,15 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, in } } + //determine the type of spell target we have + CastAction_type CastAction; + if (!DetermineSpellTargets(spell_id, spell_target, ae_center, CastAction, slot, isproc)) { + LogSpells("Spell [{}]: Determine spell targets failure.", spell_id); + return(false); + } + //If spell was casted then we already checked these so skip, otherwise check here if being called directly from spell finished. - if (!from_casted_spell){ + if (!from_casted_spell) { if (!DoCastingChecksZoneRestrictions(true, spell_id)) { LogSpells("Spell [{}]: Zone restriction failure.", spell_id); return false; @@ -2313,13 +2320,6 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, in } } - //determine the type of spell target we have - CastAction_type CastAction; - if (!DetermineSpellTargets(spell_id, spell_target, ae_center, CastAction, slot, isproc)) { - LogSpells("Spell [{}]: Determine spell targets failure.", spell_id); - return(false); - } - LogSpells("Spell [{}]: target type [{}], target [{}], AE center [{}]", spell_id, CastAction, spell_target?spell_target->GetName():"NONE", ae_center?ae_center->GetName():"NONE"); // if a spell has the AEDuration flag, it becomes an AE on target