From 1cdc2ec377463135e248a9dddcb4d9aae73949db Mon Sep 17 00:00:00 2001 From: bash Date: Sat, 9 May 2026 13:34:09 +0200 Subject: [PATCH] fix(Core/Travel): Drop short-distance short-circuit in GetFullPath --- src/Mgr/Travel/TravelNode.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/Mgr/Travel/TravelNode.cpp b/src/Mgr/Travel/TravelNode.cpp index df77344ac..5ca6a5304 100644 --- a/src/Mgr/Travel/TravelNode.cpp +++ b/src/Mgr/Travel/TravelNode.cpp @@ -1290,14 +1290,18 @@ bool TravelNodeMap::GetFullPath(TravelPlan& plan, plan.Reset(); plan.destination = destination; - // Short distance — direct walk, no nodes needed - if (botPos.fDist(destination) < MAX_PATHFINDING_DISTANCE && - botPos.GetMapId() == destination.GetMapId()) - { - plan.steps.addPoint(botPos, PathNodeType::NODE_PREPATH); - plan.steps.addPoint(destination, PathNodeType::NODE_PATH); - return true; - } + // Removed the "short distance — direct walk" short-circuit that + // returned a 2-point plan [botPos, destination] without any + // navmesh validation. NODE_PREPATH dispatch then MoveTo'd the + // destination as a single straight-line spline, which clipped + // through walls/mountains whenever bot and dest sat on opposite + // sides of geometry within 296y. + // + // Falling through to the graph build here means: if a graph + // route exists, use it (now validated by IsPathCheating in + // BuildPath + RefineWalkPoints at runtime); otherwise return + // false so MoveFarTo falls through to its chained mmap probe, + // which resolves an mmap-clean waypoint chain. std::shared_lock guard(m_nMapMtx);