From 9106bc673b981a7b41ab9ce88d9ca7bc36c3cb2c Mon Sep 17 00:00:00 2001 From: bash Date: Thu, 14 May 2026 21:59:35 +0200 Subject: [PATCH] fix(Core/Travel): LOS gate on empty-probe single-waypoint fallback --- src/Ai/World/Rpg/Action/NewRpgBaseAction.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Ai/World/Rpg/Action/NewRpgBaseAction.cpp b/src/Ai/World/Rpg/Action/NewRpgBaseAction.cpp index f4dafb69a..f1177ab5b 100644 --- a/src/Ai/World/Rpg/Action/NewRpgBaseAction.cpp +++ b/src/Ai/World/Rpg/Action/NewRpgBaseAction.cpp @@ -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(),