mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-06-20 15:39:25 +02:00
fix(Core/Travel): Trust travelnode waypoints when AC mmap rejects segments
This commit is contained in:
parent
5c11a831b9
commit
33a4e4b4b2
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user