From f44e0d225014125f9b0280dfd9309fee739015b2 Mon Sep 17 00:00:00 2001 From: bash Date: Thu, 14 May 2026 21:21:40 +0200 Subject: [PATCH] fix(Core/Travel): Trust travelnode waypoints when AC mmap rejects segments --- src/Ai/Base/Actions/MovementActions.cpp | 26 +++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/Ai/Base/Actions/MovementActions.cpp b/src/Ai/Base/Actions/MovementActions.cpp index 6fae3d3f4..c5154cb12 100644 --- a/src/Ai/Base/Actions/MovementActions.cpp +++ b/src/Ai/Base/Actions/MovementActions.cpp @@ -3230,20 +3230,22 @@ bool MovementAction::RefineWalkPoints(std::vector& walkPoints) // "would walk through walls"). std::vector segPath = bPos.getPathStepFrom(aPos, bot); - if (segPath.empty()) - { - // Live mmap refuses A->B. Caller should abort the plan - // and let MoveFarTo's own probe re-derive a route. - return false; - } + // Travelnode waypoints are authoritative once a plan is + // active. When AC mmap can't validate the segment (empty + // result, or IsPathCheating rejects a 2-point shortcut / + // steep hop), fall back to dispatching the raw (A, B) pair + // instead of aborting the plan. Common cases: cmangos + // waypoints landing in 1y navmesh gaps from AC extractor + // differences, tile-edge artifacts at zone borders. + bool const trustRaw = segPath.empty() || + TravelPath::IsPathCheating(segPath, aPos.distance(bPos)); - // Reject "pathfinder cheating" — same checks the offline gen - // applies to BuildPath. Catches cached segments where the - // live navmesh still produces a near-vertical hop or a - // 2-point straight line through geometry. - if (TravelPath::IsPathCheating(segPath, aPos.distance(bPos))) + if (trustRaw) { - return false; + if (i == 0) + refined.emplace_back(a); + refined.emplace_back(b); + continue; } // First segment: include its start point so the spline