From 20a8ec1ef0150867074d28a2f3a37c5f545c6fe2 Mon Sep 17 00:00:00 2001 From: bash Date: Thu, 14 May 2026 23:09:41 +0200 Subject: [PATCH] fix(Core/RPG): Stop next to quest objects instead of on top of them --- src/Ai/World/Rpg/Action/NewRpgBaseAction.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Ai/World/Rpg/Action/NewRpgBaseAction.cpp b/src/Ai/World/Rpg/Action/NewRpgBaseAction.cpp index 1c75f3b56..43e1b55ac 100644 --- a/src/Ai/World/Rpg/Action/NewRpgBaseAction.cpp +++ b/src/Ai/World/Rpg/Action/NewRpgBaseAction.cpp @@ -462,7 +462,9 @@ bool NewRpgBaseAction::MoveWorldObjectTo(ObjectGuid guid, float distance) angle = object->GetOrientation() + (M_PI * irand(-25, 25) / 100.0); // 45 degrees infront of target (leading it's movement) - float rnd = rand_norm(); + // Bias toward the full radius so the bot stops next to the object, + // not on top of it. Uniform rnd would put dest anywhere in [0, distance]. + float rnd = 0.85f + 0.15f * rand_norm(); x += cos(angle) * distance * rnd; y += sin(angle) * distance * rnd; if (!object->GetMap()->CheckCollisionAndGetValidCoords(object, object->GetPositionX(), object->GetPositionY(),