From 323f144984990aecf182939463083e86e44ed54e Mon Sep 17 00:00:00 2001 From: nytmyr <53322305+nytmyr@users.noreply.github.com> Date: Sun, 26 Jan 2025 22:23:55 -0600 Subject: [PATCH] Cleanup BlockedBuffs logic in SpellOnTarget --- zone/spells.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/zone/spells.cpp b/zone/spells.cpp index 6a8ba036f..9e63aaadb 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -4062,13 +4062,22 @@ bool Mob::SpellOnTarget( return false; } + bool client_blocked_buffs = + RuleB(Spells, EnableBlockedBuffs) && + ( + spelltar->IsClient() || + (spelltar->IsPet() && spelltar->IsPetOwnerClient()) + ); + + bool bot_blocked_buffs = + RuleB(Bots, AllowBotBlockedBuffs) && + ( + spelltar->IsBot() || + (spelltar->IsPet() && spelltar->IsPetOwnerBot()) + ); + // now check if the spell is allowed to land - if ( - (RuleB(Spells, EnableBlockedBuffs) && spelltar->IsClient()) || - (RuleB(Spells, EnableBlockedBuffs) && spelltar->IsPet() && spelltar->GetOwner() && spelltar->GetOwner()->IsClient()) || - (RuleB(Bots, AllowBotBlockedBuffs) && spelltar->IsBot()) || - (RuleB(Bots, AllowBotBlockedBuffs) && spelltar->IsPet() && spelltar->GetOwner() && spelltar->GetOwner()->IsBot()) - ) { + if (client_blocked_buffs || bot_blocked_buffs) { // We return true here since the caster's client should act like normal if (spelltar->IsBlockedBuff(spell_id)) { LogSpells(