From c72a37a4346d917fb9a83e9d321d5fc625dc5197 Mon Sep 17 00:00:00 2001 From: Gangsta <48196367+GangstaEQ@users.noreply.github.com> Date: Thu, 8 Jul 2021 09:39:58 -0700 Subject: [PATCH] [Bugfix] Fixes guards assisting mobs against players (#1448) Co-authored-by: ProducerZekServer --- zone/attack.cpp | 4 ++-- zone/spells.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/zone/attack.cpp b/zone/attack.cpp index 980bd0dc9..d7450c341 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -1524,7 +1524,7 @@ bool Client::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, b //Guard Assist Code if (RuleB(Character, PVPEnableGuardFactionAssist)) { - if (IsClient() || (HasOwner() && GetOwner()->IsClient())) { + if (IsClient() && other->IsClient() || (HasOwner() && GetOwner()->IsClient() && other->IsClient() )) { auto& mob_list = entity_list.GetCloseMobList(other); for (auto& e : mob_list) { auto mob = e.second; @@ -2023,7 +2023,7 @@ bool NPC::Attack(Mob* other, int Hand, bool bRiposte, bool IsStrikethrough, bool //Guard Assist Code if (RuleB(Character, PVPEnableGuardFactionAssist)) { - if (IsClient() || (HasOwner() && GetOwner()->IsClient())) { + if (IsClient() && other->IsClient() || (HasOwner() && GetOwner()->IsClient() && other->IsClient())) { auto& mob_list = entity_list.GetCloseMobList(other); for (auto& e : mob_list) { auto mob = e.second; diff --git a/zone/spells.cpp b/zone/spells.cpp index dee96509e..c7029b73d 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -2057,7 +2057,7 @@ bool Mob::SpellFinished(uint16 spell_id, Mob *spell_target, CastingSlot slot, ui //Guard Assist Code if (RuleB(Character, PVPEnableGuardFactionAssist) && spell_target && IsDetrimentalSpell(spell_id) && spell_target != this) { - if (IsClient() || (HasOwner() && GetOwner()->IsClient())) { + if (IsClient() && spell_target->IsClient()|| (HasOwner() && GetOwner()->IsClient() && spell_target->IsClient())) { auto& mob_list = entity_list.GetCloseMobList(spell_target); for (auto& e : mob_list) { auto mob = e.second;