mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-06-20 23:49:25 +02:00
Revert "fix(Core/Movement): Force replan when dest shifts >40y from cached spline endpoint"
This reverts commit 82bf33f3d40fcf95deb7469f36401d1534718db9.
This commit is contained in:
parent
82bf33f3d4
commit
7b60310c4e
@ -72,16 +72,7 @@ bool NewRpgBaseAction::MoveFarTo(WorldPosition dest)
|
|||||||
if (bot->isMoving() && lastMove.lastMoveToMapId == bot->GetMapId())
|
if (bot->isMoving() && lastMove.lastMoveToMapId == bot->GetMapId())
|
||||||
{
|
{
|
||||||
float remaining = bot->GetExactDist(lastMove.lastMoveToX, lastMove.lastMoveToY, lastMove.lastMoveToZ);
|
float remaining = bot->GetExactDist(lastMove.lastMoveToX, lastMove.lastMoveToY, lastMove.lastMoveToZ);
|
||||||
// Only ride the existing spline if the cached endpoint is
|
if (remaining > 10.0f)
|
||||||
// still close to the requested dest. A dest shift > 40y is
|
|
||||||
// a target change (objective POI -> turn-in NPC, new POI
|
|
||||||
// selection, …) and needs a fresh travelplan/mmap probe;
|
|
||||||
// otherwise the bot rides a stale spline straight through
|
|
||||||
// geometry.
|
|
||||||
float endpointToDest = dest.distance(WorldPosition(
|
|
||||||
lastMove.lastMoveToMapId, lastMove.lastMoveToX,
|
|
||||||
lastMove.lastMoveToY, lastMove.lastMoveToZ));
|
|
||||||
if (remaining > 10.0f && endpointToDest <= 40.0f)
|
|
||||||
{
|
{
|
||||||
EmitDebugMove("MoveFar", "spline-plan",
|
EmitDebugMove("MoveFar", "spline-plan",
|
||||||
lastMove.lastMoveToX, lastMove.lastMoveToY, lastMove.lastMoveToZ);
|
lastMove.lastMoveToX, lastMove.lastMoveToY, lastMove.lastMoveToZ);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user