Cleanup BlockedBuffs logic in SpellOnTarget

This commit is contained in:
nytmyr
2025-01-26 22:23:55 -06:00
parent 3dfa099718
commit 323f144984
+15 -6
View File
@@ -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(