fix(Core/RPG): Skip MoveFar:spline fallback when target is not in LOS

This commit is contained in:
bash 2026-05-05 00:02:46 +02:00
parent 80c5db07b8
commit 15f7c140c9

View File

@ -322,17 +322,22 @@ bool NewRpgBaseAction::MoveFarTo(WorldPosition dest)
} }
// Empty / non-progressing path falls back to dispatching the // Empty / non-progressing path falls back to dispatching the
// destination as a single waypoint. Best-effort spline; // destination as a single waypoint. Spline only when target is
// UnstuckAction (5/10 min) is the eventual catch if this loops // line-of-sight: dispatching a straight line through walls
// forever. // produces visible clipping/glitching. If LOS is blocked we
LOG_INFO("playerbots", "[MoveFar] {} spline | dis={:.0f} | probe.empty={} | mmapFails={} nodeFails={} | flags={}{}{}", // refuse and let UnstuckAction (5/10 min) catch the stuck.
bool const inLOS = bot->IsWithinLOS(dest.GetPositionX(), dest.GetPositionY(), dest.GetPositionZ());
LOG_INFO("playerbots", "[MoveFar] {} spline | dis={:.0f} | probe.empty={} | LOS={} | mmapFails={} nodeFails={} | flags={}{}{}",
bot->GetName(), dis, bot->GetName(), dis,
probe.empty() ? "y" : "n", probe.empty() ? "y" : "n",
inLOS ? "y" : "n",
botAI->rpgInfo.CountRecentAttempts(dest, false), botAI->rpgInfo.CountRecentAttempts(dest, false),
botAI->rpgInfo.CountRecentAttempts(dest, true), botAI->rpgInfo.CountRecentAttempts(dest, true),
forceMmapOverNodes ? "F-mmap " : "", forceMmapOverNodes ? "F-mmap " : "",
forceNodesOverMmap ? "F-nodes " : "", forceNodesOverMmap ? "F-nodes " : "",
bothExhausted ? "EXHAUST " : ""); bothExhausted ? "EXHAUST " : "");
if (!inLOS)
return false; // Refuse to dispatch a straight line through geometry.
{ {
char fails[32]; char fails[32];
snprintf(fails, sizeof(fails), "mF=%d nF=%d", snprintf(fails, sizeof(fails), "mF=%d nF=%d",