From a3085be4c3b2abe76b47c64aca7f4b17ff3640e1 Mon Sep 17 00:00:00 2001 From: nytmyr <53322305+nytmyr@users.noreply.github.com> Date: Sun, 2 Feb 2025 08:40:27 -0600 Subject: [PATCH] Cleanup DetermineSpellTargets->ST_Pet --- zone/spells.cpp | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/zone/spells.cpp b/zone/spells.cpp index 546fb32ac..2f5ccbe3a 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -2073,23 +2073,21 @@ bool Mob::DetermineSpellTargets(uint16 spell_id, Mob *&spell_target, Mob *&ae_ce } case ST_Pet: { - if ( - !( - IsBot() && - spell_target && - spell_target->GetOwner() != this && - RuleB(Bots, CanCastPetOnlyOnOthersPets) - ) - ) { + bool bot_casting_on_other_pet = IsBot() && + spell_target && + spell_target->GetOwner() != this && + RuleB(Bots, CanCastPetOnlyOnOthersPets); + if (!bot_casting_on_other_pet) { spell_target = GetPet(); } - if(!spell_target) - { + + if (!spell_target) { LogSpells("Spell [{}] canceled: invalid target (no pet)", spell_id); - MessageString(Chat::Red,NO_PET); - return false; // can't cast these unless we have a target + MessageString(Chat::Red, NO_PET); + return false; // Can't cast these unless we have a target } + CastAction = SingleTarget; break; }