From 570787ff16d90dc527dbbbbcba51440906e9a6e9 Mon Sep 17 00:00:00 2001 From: SaW Date: Wed, 18 Dec 2024 18:29:35 +0100 Subject: [PATCH] Improve check to work in custom defines zones as well (#797) --- src/strategy/actions/AttackAction.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/strategy/actions/AttackAction.cpp b/src/strategy/actions/AttackAction.cpp index 3600ce66..4be5da24 100644 --- a/src/strategy/actions/AttackAction.cpp +++ b/src/strategy/actions/AttackAction.cpp @@ -105,7 +105,8 @@ bool AttackAction::Attack(Unit* target, bool with_pet /*true*/) return false; } - if (!bot->IsValidAttackTarget(target) && sPlayerbotAIConfig->IsInPvpProhibitedZone(bot->GetZoneId())) + if (sPlayerbotAIConfig->IsInPvpProhibitedZone(bot->GetZoneId()) + && (target->IsPlayer() || target->IsPet() || !bot->IsValidAttackTarget(target))) { if (verbose) botAI->TellError("I cannot attack others in PvP prohibited zones");