Skip to content

Fix to melee dead-zone#275

Open
bozimmerman wants to merge 1 commit intomangoszero:masterfrom
bozimmerman:bot_melee_deadzone
Open

Fix to melee dead-zone#275
bozimmerman wants to merge 1 commit intomangoszero:masterfrom
bozimmerman:bot_melee_deadzone

Conversation

@bozimmerman
Copy link
Contributor

@bozimmerman bozimmerman commented Mar 16, 2026

Fix to return false from Attack when no target. Pretty straightforward, that one.

The ReachMeleeAction for bots fixes a melee "dead zone" problem, and is more subtle, and needs explaining:

On the surface, it just looks like the code simply extends the melee range beyond the basic 1.5; and it does -- but it's not really the distance itself that was important, but the distance from the target "distance" (i.e. the difference).

You see, when the bot is told to move less than a minimal distance from target, no movement actually occurs. This is probably a great idea to prevent jittery micro-adjustments. However, the side effect was this: if you were 1.7 yards from your melee target, ReachMeleeAction would determine that you needed to move 0.2 yards and so prevent any other actions until you do so, which would then be rejected by the movement code for being too small. This kept the bot Frozen 0.2 yards away from the position at which it would be allowed to attack. So, by extending the difference between the target range and acceptable range to something larger than minimum, we guarantee it is either acceptable, or that the bot WILL move into range.


This change is Reviewable

Copilot AI review requested due to automatic review settings March 16, 2026 03:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts playerbot combat movement/attack behavior to improve melee engagement logic and avoid a null-target path during attacks.

Changes:

  • Refines ReachMeleeAction::isUseful() to change when the bot decides to move into melee range.
  • Fixes AttackAction::Attack() to return false for a null target regardless of verbose, preventing unsafe fall-through.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/modules/Bots/playerbot/strategy/actions/ReachTargetActions.h Changes the usefulness condition for the “reach melee” action (when to close distance).
src/modules/Bots/playerbot/strategy/actions/AttackAction.cpp Ensures Attack() returns early when target is null, independent of verbosity.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@AppVeyorBot
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants