mirror of
https://github.com/liyunfan1223/mod-playerbots.git
synced 2026-06-20 15:39:25 +02:00
Revert "fix(Core/Travel): LOS check before trusting raw cmangos waypoints"
This commit is contained in:
parent
33dafd6ec0
commit
487d12711e
@ -3231,32 +3231,16 @@ bool MovementAction::RefineWalkPoints(std::vector<G3D::Vector3>& walkPoints)
|
|||||||
std::vector<WorldPosition> segPath = bPos.getPathStepFrom(aPos, bot);
|
std::vector<WorldPosition> segPath = bPos.getPathStepFrom(aPos, bot);
|
||||||
|
|
||||||
// Travelnode waypoints are authoritative once a plan is
|
// Travelnode waypoints are authoritative once a plan is
|
||||||
// active. When AC mmap can't validate the segment (empty
|
// active. When AC mmap can't validate the segment, dispatch
|
||||||
// result, or IsPathCheating rejects a 2-point shortcut /
|
// the raw (A, B) pair instead of aborting the plan. Common
|
||||||
// steep hop), fall back to dispatching the raw (A, B) pair
|
// cases: cmangos waypoints landing in 1y navmesh gaps from
|
||||||
// instead of aborting the plan — but only if vmap LOS is
|
// AC extractor differences, tile-edge artifacts at zone
|
||||||
// clear between A and B. Without LOS check, "trust raw"
|
// borders.
|
||||||
// tunnels through visual-only obstacles (trees, models) that
|
bool const trustRaw = segPath.empty() ||
|
||||||
// aren't in the navmesh.
|
|
||||||
bool const mmapFail = segPath.empty() ||
|
|
||||||
TravelPath::IsPathCheating(segPath, aPos.distance(bPos));
|
TravelPath::IsPathCheating(segPath, aPos.distance(bPos));
|
||||||
|
|
||||||
if (mmapFail)
|
if (trustRaw)
|
||||||
{
|
{
|
||||||
Map* m = bot->GetMap();
|
|
||||||
bool const inLos = m && m->isInLineOfSight(
|
|
||||||
a.x, a.y, a.z + 1.0f,
|
|
||||||
b.x, b.y, b.z + 1.0f,
|
|
||||||
bot->GetPhaseMask(), LINEOFSIGHT_ALL_CHECKS, VMAP::ModelIgnoreFlags::Nothing);
|
|
||||||
|
|
||||||
if (!inLos)
|
|
||||||
{
|
|
||||||
// Visual obstacle between A and B — don't tunnel.
|
|
||||||
// Abort the plan so MoveFarTo can re-derive a route
|
|
||||||
// that mmap can verify.
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (i == 0)
|
if (i == 0)
|
||||||
refined.emplace_back(a);
|
refined.emplace_back(a);
|
||||||
refined.emplace_back(b);
|
refined.emplace_back(b);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user