mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-06-20 23:49:25 +02:00
fix(Core/Travel): Drop 2-point check, keep last-segment teleport guard
This commit is contained in:
parent
39a8bf4396
commit
8662316212
@ -226,16 +226,10 @@ TravelNodePath* TravelNode::BuildPath(TravelNode* endNode, Unit* bot, bool postP
|
|||||||
|
|
||||||
bool canPath = endPos->isPathTo(path); // Check if we reached our destination.
|
bool canPath = endPos->isPathTo(path); // Check if we reached our destination.
|
||||||
|
|
||||||
// Reject 2-point paths between non-adjacent nodes — that's
|
// Reject long final segments. Catches both BuildShortcut 2-point
|
||||||
// PathGenerator's BuildShortcut fallback "teleporting" the chain
|
// teleports (start → end straight line) and chained-probe stalls
|
||||||
// endpoint across whatever lies between, not a real walkable route.
|
// where mmap "teleported" to the destination as the final waypoint
|
||||||
if (canPath && path.size() == 2 && getPosition()->distance(endNode->getPosition()) > 5.0f)
|
// after the chain dead-ended. Bot would air-walk that jump.
|
||||||
canPath = false;
|
|
||||||
|
|
||||||
// Reject long final segments. If the last waypoint is >75y from
|
|
||||||
// the second-to-last, the chained probe stalled mid-route and
|
|
||||||
// mmap "teleported" to the destination as the final waypoint —
|
|
||||||
// the bot would air-walk that jump. Path is not a valid route.
|
|
||||||
if (canPath && path.size() >= 2 && path[path.size() - 2].distance(&path.back()) > 75.0f)
|
if (canPath && path.size() >= 2 && path[path.size() - 2].distance(&path.back()) > 75.0f)
|
||||||
canPath = false;
|
canPath = false;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user