[Bug Fix] Fix ST_TargetsTarget Spells with Restrictions (#2746)

This commit is contained in:
Aeadoin 2023-01-15 17:55:34 -05:00 committed by GitHub
parent 7fa421d848
commit dd40f2a0e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 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)) { if (!DoCastingChecksZoneRestrictions(true, spell_id)) {
LogSpells("Spell [{}]: Zone restriction failure.", spell_id); LogSpells("Spell [{}]: Zone restriction failure.", spell_id);
return false; 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"); 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 // if a spell has the AEDuration flag, it becomes an AE on target