From d0d8f3a40f07eab493d9277771da5419f48d4c22 Mon Sep 17 00:00:00 2001 From: Revision Date: Sun, 21 Jul 2024 22:43:39 +0200 Subject: [PATCH] Fix: Bots attacking players not flagged --- src/strategy/actions/AttackAction.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/strategy/actions/AttackAction.cpp b/src/strategy/actions/AttackAction.cpp index 1ba9f4b5..61efe14f 100644 --- a/src/strategy/actions/AttackAction.cpp +++ b/src/strategy/actions/AttackAction.cpp @@ -95,6 +95,16 @@ bool AttackAction::Attack(Unit* target, bool with_pet /*true*/) return false; } + if (target->IsPlayer() && !target->IsPvP() && !target->IsFFAPvP() && (!bot->duel || bot->duel->Opponent != target || bot->duel->StartTime)) + { + if (verbose) + { + botAI->TellError(Acore::StringFormat("%s is not flagged for pvp", target->GetName())); + } + + return false; + } + if (bot->IsMounted() && bot->IsWithinLOSInMap(target)) { WorldPacket emptyPacket;