mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-06-20 23:49:25 +02:00
fix(Core/Travel): Reject 2-point BuildShortcut teleports in chained probe
This commit is contained in:
parent
c04ee595de
commit
e8b4461d33
@ -752,6 +752,14 @@ std::vector<WorldPosition> WorldPosition::getPathStepFrom(WorldPosition startPos
|
|||||||
|
|
||||||
std::vector<WorldPosition> retvec = fromPointsArray(points);
|
std::vector<WorldPosition> 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
|
// Underwater path-extension. When PATHFIND_INCOMPLETE ends within
|
||||||
// 50y of dest and both endpoints are underwater with LOS, extend
|
// 50y of dest and both endpoints are underwater with LOS, extend
|
||||||
// by one 5y step (or straight to dest if <5y). Lets bots traverse
|
// by one 5y step (or straight to dest if <5y). Lets bots traverse
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user