feat(Core/Debug): Restore mmap-empty/mmap-noprogress/spline-blocked visibility whispers

This commit is contained in:
bash 2026-05-08 15:01:17 +02:00
parent 6b07f9f9c2
commit 04af497cd1

View File

@ -314,6 +314,27 @@ bool NewRpgBaseAction::MoveFarTo(WorldPosition dest)
} }
} }
// Probe failed or didn't progress — emit visibility whisper so
// the user can see WHY mmap didn't dispatch. Without this the
// do-quest action's `MoveRandomNear` nudge appears with no
// preceding MoveFar whisper, and the failure mode is invisible.
{
bool const probeProgressed = !probe.empty() && probe.size() >= 2 &&
(dest.GetExactDist(probe.back().GetPositionX(),
probe.back().GetPositionY(), probe.back().GetPositionZ()) + 5.0f < disToDest);
if (!probeProgressed)
{
char fails[32];
snprintf(fails, sizeof(fails), "mF=%d nF=%d",
botAI->rpgInfo.CountRecentAttempts(dest, false),
botAI->rpgInfo.CountRecentAttempts(dest, true));
char const* reason = (probe.empty() || probe.size() < 2) ? "mmap-empty" : "mmap-noprogress";
EmitDebugMove("MoveFar", reason,
dest.GetPositionX(), dest.GetPositionY(),
dest.GetPositionZ(), fails);
}
}
// Empty / non-progressing path falls back to dispatching the // Empty / non-progressing path falls back to dispatching the
// destination as a single waypoint. Spline only when target is // destination as a single waypoint. Spline only when target is
// line-of-sight: dispatching a straight line through walls // line-of-sight: dispatching a straight line through walls
@ -330,7 +351,16 @@ bool NewRpgBaseAction::MoveFarTo(WorldPosition dest)
forceNodesOverMmap ? "F-nodes " : "", forceNodesOverMmap ? "F-nodes " : "",
bothExhausted ? "EXHAUST " : ""); bothExhausted ? "EXHAUST " : "");
if (!inLOS) if (!inLOS)
{
char fails[32];
snprintf(fails, sizeof(fails), "mF=%d nF=%d",
botAI->rpgInfo.CountRecentAttempts(dest, false),
botAI->rpgInfo.CountRecentAttempts(dest, true));
EmitDebugMove("MoveFar", "spline-blocked",
dest.GetPositionX(), dest.GetPositionY(),
dest.GetPositionZ(), fails);
return false; // Refuse to dispatch a straight line through geometry. 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",