From 8a31caab6bc2dcb9588780a27ba7574f14134e19 Mon Sep 17 00:00:00 2001 From: nytmyr <53322305+nytmyr@users.noreply.github.com> Date: Sun, 2 Feb 2025 08:29:41 -0600 Subject: [PATCH] Cleanup range/aoe_range check in SpellFinished --- zone/spells.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/zone/spells.cpp b/zone/spells.cpp index 2fe492f4a..8ef246739 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -2537,12 +2537,11 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, in //range check our target, if we have one and it is not us float range = spells[spell_id].range + GetRangeDistTargetSizeMod(spell_target); - if ( - ( - (IsClient() && CastToClient()->TGB()) || (IsBot() && RuleB(Bots, EnableBotTGB)) - ) && - IsTGBCompatibleSpell(spell_id) && IsGroupSpell(spell_id) - ) { + bool can_use_tgb = (IsClient() && CastToClient()->TGB()) || (IsBot() && RuleB(Bots, EnableBotTGB)); + bool is_tgb_compatible = IsTGBCompatibleSpell(spell_id); + bool is_group_spell = IsGroupSpell(spell_id); + + if (can_use_tgb && is_tgb_compatible && is_group_spell) { range = spells[spell_id].aoe_range; }