diff --git a/src/strategy/actions/AttackAction.cpp b/src/strategy/actions/AttackAction.cpp index d1dd232b..0ff90ba7 100644 --- a/src/strategy/actions/AttackAction.cpp +++ b/src/strategy/actions/AttackAction.cpp @@ -112,8 +112,9 @@ bool AttackAction::Attack(Unit* target, bool with_pet /*true*/) bot->SetSelection(target->GetGUID()); Unit* oldTarget = context->GetValue("current target")->Get(); + bool melee = bot->IsWithinMeleeRange(target) || botAI->IsMelee(bot); - if (oldTarget == target && botAI->GetState() == BOT_STATE_COMBAT && bot->GetVictim() == target) + if (oldTarget == target && botAI->GetState() == BOT_STATE_COMBAT && bot->GetVictim() == target && (bot->HasUnitState(UNIT_STATE_MELEE_ATTACKING) == melee)) return false; context->GetValue("old target")->Set(oldTarget); @@ -129,7 +130,6 @@ bool AttackAction::Attack(Unit* target, bool with_pet /*true*/) bot->StopMoving(); } - bool melee = bot->IsWithinMeleeRange(target) || botAI->IsMelee(bot); if (IsMovingAllowed() && !bot->HasInArc(CAST_ANGLE_IN_FRONT, target)) {