mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-06-20 15:39:25 +02:00
Revert "fix(Core/Travel): Drop short-distance short-circuit in GetFullPath"
This reverts commit 71dcd6ff09c4cb1975500e3ce5877dbb6018ca91.
This commit is contained in:
parent
1cdc2ec377
commit
999c5343fa
@ -1290,18 +1290,14 @@ bool TravelNodeMap::GetFullPath(TravelPlan& plan,
|
||||
plan.Reset();
|
||||
plan.destination = destination;
|
||||
|
||||
// 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.
|
||||
// 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;
|
||||
}
|
||||
|
||||
std::shared_lock<std::shared_timed_mutex> guard(m_nMapMtx);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user