From 63b1e6b4b405a6cd66c9bf0de03a8f10d5826d18 Mon Sep 17 00:00:00 2001 From: nytmyr <53322305+nytmyr@users.noreply.github.com> Date: Fri, 21 Feb 2025 23:12:50 -0600 Subject: [PATCH] [Bots] Improve positioning (#4709) - Prevent bots not set to ^behindmob from finding positions behind their target. - Backs up a bot if they're too close and have target reflection, not just taunting bots. - Backs up bots if the target is rooting and they are not taunting to the appropriate position. - This will particularly help with casters running around. --- zone/bot.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/zone/bot.cpp b/zone/bot.cpp index 38c4aa0b7..dc7a09dfd 100644 --- a/zone/bot.cpp +++ b/zone/bot.cpp @@ -11830,15 +11830,15 @@ void Bot::DoCombatPositioning( } else if (tar->IsRooted() && !IsTaunting()) { // Move non-taunters out of range - Above already checks if bot is targeted, otherwise they would stay if (tar_distance <= melee_distance_max) { - if (PlotBotPositionAroundTarget(tar, Goal.x, Goal.y, Goal.z, (melee_distance_max + 1), (melee_distance_max * 2), false, IsTaunting())) { + if (PlotBotPositionAroundTarget(tar, Goal.x, Goal.y, Goal.z, (melee_distance_max + 1), (melee_distance_max * 2), GetBehindMob(), false)) { RunToGoalWithJitter(Goal); return; } } } - else if (IsTaunting() && ((tar_distance < melee_distance_min) || !front_mob)) { // Back up any bots that are too close - if (PlotBotPositionAroundTarget(tar, Goal.x, Goal.y, Goal.z, melee_distance_min, melee_distance, false, IsTaunting())) { + else if (tar_distance < melee_distance_min || (!front_mob && IsTaunting())) { // Back up any bots that are too close + if (PlotBotPositionAroundTarget(tar, Goal.x, Goal.y, Goal.z, melee_distance_min, melee_distance, GetBehindMob(), (IsTaunting() || !GetBehindMob()))) { RunToGoalWithJitter(Goal); return; @@ -11873,8 +11873,8 @@ void Bot::DoCombatPositioning( } } } - else if (tar_distance < melee_distance_min || (GetBehindMob() && !behind_mob) || (IsTaunting() && !front_mob)|| !HasRequiredLoSForPositioning(tar)) { // Regular adjustment - if (PlotBotPositionAroundTarget(tar, Goal.x, Goal.y, Goal.z, melee_distance_min, melee_distance, GetBehindMob(), IsTaunting())) { + else if (tar_distance < melee_distance_min || (GetBehindMob() && !behind_mob) || (IsTaunting() && !front_mob) || !HasRequiredLoSForPositioning(tar)) { // Regular adjustment + if (PlotBotPositionAroundTarget(tar, Goal.x, Goal.y, Goal.z, melee_distance_min, melee_distance, GetBehindMob(), (IsTaunting() || !GetBehindMob()))) { RunToGoalWithJitter(Goal); return;