From 8efe3a4321a60da9b961692d4b59844919031ac5 Mon Sep 17 00:00:00 2001 From: bash Date: Sun, 31 May 2026 00:10:39 +0200 Subject: [PATCH] fix(Core/Travel): Tighten GetFullPath probe gate so graph routing wins when probe misses --- src/Mgr/Travel/TravelNode.cpp | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/src/Mgr/Travel/TravelNode.cpp b/src/Mgr/Travel/TravelNode.cpp index 936e5a5a1..f56e1e9e7 100644 --- a/src/Mgr/Travel/TravelNode.cpp +++ b/src/Mgr/Travel/TravelNode.cpp @@ -1684,31 +1684,20 @@ TravelPath TravelNodeMap::GetFullPath(WorldPosition botPos, uint32 botZoneId, { TravelPath path; - // mmap-probe first: if a 40-step probe makes meaningful progress, - // prefer it over the graph. Loosened from "reaches within spellDistance" - // because the strict gate falls through to graph routing whenever the - // probe stops a few yards short of the destination (e.g., bot can't - // reach the exact GO position, or destination is inside an area the - // probe can't fully enter). Graph paths come from DB-cached walk - // edges baked at offline generation time and can route through - // terrain that current mmaps treat as unwalkable. - // - // Accept the probe if EITHER: - // (a) it reaches within 30y of destination, OR - // (b) it makes >50% progress and got at least 30y total + // mmap-probe quick path: only accept if the probe REACHES the + // destination (within spellDistance). A partial-progress probe is + // refused so the graph A* gets a chance — graph nodes can route + // through cave entries / dungeon edges that the raw mmap probe can't + // anchor on. Earlier looser acceptance (>50% progress) caused the + // bot to take a partial probe pointed at terrain instead of using + // the travel-node graph that has a node inside the destination. if (botPos.GetMapId() == destination.GetMapId()) { std::vector probe = destination.getPathFromPath({botPos}, bot, 40); if (probe.size() >= 2) { - float const totalDist = botPos.distance(destination); float const probeEndToDest = destination.distance(probe.back()); - float const probeProgress = totalDist - probeEndToDest; - - bool const closeEnough = probeEndToDest < 30.0f; - bool const meaningfulProgress = probeProgress > totalDist * 0.5f && probeProgress > 30.0f; - - if (closeEnough || meaningfulProgress) + if (probeEndToDest < sPlayerbotAIConfig.spellDistance) { path.addPoint(botPos, PathNodeType::NODE_PREPATH); for (size_t i = 1; i < probe.size(); ++i)