From d4c0390a2e8ba2b1b9d988361c3fad3b2394af1c Mon Sep 17 00:00:00 2001 From: Yunfan Li Date: Sun, 23 Jun 2024 15:53:33 +0800 Subject: [PATCH] [Class spell] Fix attack action for ranged --- 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 978eb1d9..f0d85a8c 100644 --- a/src/strategy/actions/AttackAction.cpp +++ b/src/strategy/actions/AttackAction.cpp @@ -110,7 +110,8 @@ bool AttackAction::Attack(Unit* target, bool with_pet /*true*/) context->GetValue("current target")->Set(target); context->GetValue("available loot")->Get()->Add(guid); - bool attacked = bot->Attack(target, true); + bool melee = bot->IsWithinMeleeRange(target) || botAI->IsMelee(bot); + bot->Attack(target, melee); if (IsMovingAllowed() && !bot->HasInArc(CAST_ANGLE_IN_FRONT, target)) { sServerFacade->SetFacingTo(bot, target);