mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-06-20 15:39:25 +02:00
feat(Core/Debug): Restore mmap-empty/mmap-noprogress/spline-blocked visibility whispers
This commit is contained in:
parent
14880b8547
commit
aa1194d8c7
@ -315,6 +315,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
|
||||||
@ -331,7 +352,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",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user