fix(Core/Travel): Trust travelnode waypoints when AC mmap rejects segments

This commit is contained in:
bash 2026-05-14 21:21:40 +02:00
parent ae5f9e6ff1
commit 21c981bd35

View File

@ -3230,20 +3230,22 @@ bool MovementAction::RefineWalkPoints(std::vector<G3D::Vector3>& walkPoints)
// "would walk through walls"). // "would walk through walls").
std::vector<WorldPosition> segPath = bPos.getPathStepFrom(aPos, bot); std::vector<WorldPosition> segPath = bPos.getPathStepFrom(aPos, bot);
if (segPath.empty()) // Travelnode waypoints are authoritative once a plan is
{ // active. When AC mmap can't validate the segment (empty
// Live mmap refuses A->B. Caller should abort the plan // result, or IsPathCheating rejects a 2-point shortcut /
// and let MoveFarTo's own probe re-derive a route. // steep hop), fall back to dispatching the raw (A, B) pair
return false; // 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 if (trustRaw)
// 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)))
{ {
return false; if (i == 0)
refined.emplace_back(a);
refined.emplace_back(b);
continue;
} }
// First segment: include its start point so the spline // First segment: include its start point so the spline