From 324b50f1be2526f462b55e48cfbb1b11cfb9d7ce Mon Sep 17 00:00:00 2001 From: bash Date: Sun, 17 May 2026 01:00:57 +0200 Subject: [PATCH] fix(Core/RPG): Reject mmap paths whose endpoint Z misses dest --- src/Ai/World/Rpg/Action/NewRpgBaseAction.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Ai/World/Rpg/Action/NewRpgBaseAction.cpp b/src/Ai/World/Rpg/Action/NewRpgBaseAction.cpp index 0b9b580bc..3072b8418 100644 --- a/src/Ai/World/Rpg/Action/NewRpgBaseAction.cpp +++ b/src/Ai/World/Rpg/Action/NewRpgBaseAction.cpp @@ -221,6 +221,19 @@ bool NewRpgBaseAction::MoveFarTo(WorldPosition dest) stepDest.GetPositionY(), stepDest.GetPositionZ()); if (endDistToDest + 5.0f < disToDest) { + // Z gap check: if the probe's last waypoint is well below + // the requested destination Z, the chain walked the ground + // polygon graph toward an elevated target it can't reach + // (quest giver on top of Aldrassil etc.). Refuse to dispatch + // — bot waits instead of tunneling into the visual model. + if (std::fabs(stepDest.GetPositionZ() - dest.GetPositionZ()) > 5.0f) + { + EmitDebugMove("MoveFar", "z-mismatch", + dest.GetPositionX(), dest.GetPositionY(), + dest.GetPositionZ()); + return false; + } + Movement::PointsArray points; points.reserve(probe.size()); for (auto const& wp : probe)