From 8a5b6d455c50e1d41f0d9c9b14fa14b04bcf435f Mon Sep 17 00:00:00 2001 From: bash Date: Mon, 18 May 2026 01:09:46 +0200 Subject: [PATCH] fix(Core/Travel): Reject 2-point BuildShortcut teleports in chained probe --- src/Mgr/Travel/TravelMgr.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Mgr/Travel/TravelMgr.cpp b/src/Mgr/Travel/TravelMgr.cpp index 7d287e824..d027a33d7 100644 --- a/src/Mgr/Travel/TravelMgr.cpp +++ b/src/Mgr/Travel/TravelMgr.cpp @@ -752,6 +752,14 @@ std::vector WorldPosition::getPathStepFrom(WorldPosition startPos std::vector retvec = fromPointsArray(points); + // PathGenerator can also return PATHFIND_NORMAL with just two + // points (start + end) as a fallback when polygon search fails + // partway through — effectively a teleport across whatever lies + // between. Reject long 2-point segments to avoid the chained + // probe accepting a 1000y+ "shortcut" as a valid path step. + if (retvec.size() == 2 && retvec.front().distance(&retvec.back()) > 50.0f) + return {}; + // Underwater path-extension. When PATHFIND_INCOMPLETE ends within // 50y of dest and both endpoints are underwater with LOS, extend // by one 5y step (or straight to dest if <5y). Lets bots traverse