mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-06-20 15:39:25 +02:00
fix(Core/Travel): Strip AC-side meaningfulProgress branch in probe-first; match reference acceptance exactly
This commit is contained in:
parent
899f2cba94
commit
1f9fa42082
@ -1713,36 +1713,17 @@ TravelPath TravelNodeMap::GetFullPath(WorldPosition botPos, [[maybe_unused]] uin
|
|||||||
{
|
{
|
||||||
TravelPath path;
|
TravelPath path;
|
||||||
|
|
||||||
// AC-side workaround that reference doesn't have: if a 40-step mmap
|
// Probe-first short-circuit (matches reference exactly): if a 40-step
|
||||||
// probe from bot to destination either reaches close to dest OR
|
// mmap probe from bot to destination reaches within spellDistance of
|
||||||
// makes any meaningful forward progress (>30y absolute), prefer
|
// dest, use the probe directly and skip graph routing. Otherwise
|
||||||
// that direct path over the graph. The graph's K=5 endNode pick +
|
// fall through to the graph A* below — the failed probe waypoints
|
||||||
// strict 1y endPath validation rejects destinations that are
|
// would ideally feed into getRoute as startPath (reference does
|
||||||
// slightly off-mesh (cave shelves, alcoves), so without this the
|
// this; we don't yet — TODO).
|
||||||
// bot falls to a single-point MoveTo fallback and wiggles in place.
|
|
||||||
// Loosened from "50% AND >30y" to just ">30y" so a partial probe
|
|
||||||
// toward the cave entrance gets accepted; the next tick's
|
|
||||||
// re-resolve from the new bot position can extend further.
|
|
||||||
if (botPos.GetMapId() == destination.GetMapId())
|
if (botPos.GetMapId() == destination.GetMapId())
|
||||||
{
|
{
|
||||||
std::vector<WorldPosition> probe = destination.getPathFromPath({botPos}, bot, 40);
|
std::vector<WorldPosition> probe = destination.getPathFromPath({botPos}, bot, 40);
|
||||||
if (probe.size() >= 2)
|
if (destination.isPathTo(probe, sPlayerbotAIConfig.spellDistance))
|
||||||
{
|
return TravelPath(probe);
|
||||||
float const totalDist = botPos.distance(destination);
|
|
||||||
float const probeEndToDest = destination.distance(probe.back());
|
|
||||||
float const probeProgress = totalDist - probeEndToDest;
|
|
||||||
|
|
||||||
bool const closeEnough = probeEndToDest < 30.0f;
|
|
||||||
bool const meaningfulProgress = probeProgress > 30.0f;
|
|
||||||
|
|
||||||
if (closeEnough || meaningfulProgress)
|
|
||||||
{
|
|
||||||
path.addPoint(botPos, PathNodeType::NODE_PREPATH);
|
|
||||||
for (size_t i = 1; i < probe.size(); ++i)
|
|
||||||
path.addPoint(probe[i], PathNodeType::NODE_PATH);
|
|
||||||
return path;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_lock<std::shared_timed_mutex> guard(m_nMapMtx);
|
std::shared_lock<std::shared_timed_mutex> guard(m_nMapMtx);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user