mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-06-20 15:39:25 +02:00
fix(Core/Travel): LOS gate on empty-probe single-waypoint fallback
This commit is contained in:
parent
6ae973bb8e
commit
1a7e6db0c9
@ -282,6 +282,18 @@ bool NewRpgBaseAction::MoveFarTo(WorldPosition dest)
|
||||
if (bot->GetMapId() != dest.GetMapId())
|
||||
return false;
|
||||
|
||||
// LOS gate — refuse to dispatch a straight-line spline when
|
||||
// the dest isn't in line of sight. Engine PathGenerator may
|
||||
// return a BuildShortcut 2-point line through visual obstacles
|
||||
// (trees, walls) when start/end polyref resolution fails. Let
|
||||
// UnstuckAction handle prolonged stuck states.
|
||||
if (!bot->IsWithinLOS(dest.GetPositionX(), dest.GetPositionY(), dest.GetPositionZ()))
|
||||
{
|
||||
EmitDebugMove("MoveFar", "spline-blocked",
|
||||
dest.GetPositionX(), dest.GetPositionY(), dest.GetPositionZ());
|
||||
return false;
|
||||
}
|
||||
|
||||
EmitDebugMove("MoveFar", "spline",
|
||||
dest.GetPositionX(), dest.GetPositionY(), dest.GetPositionZ());
|
||||
return MoveTo(dest.GetMapId(), dest.GetPositionX(), dest.GetPositionY(), dest.GetPositionZ(),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user