implemented regular mounting check when traveling over ground nodes and stopped travel graph from planning routes through unintentioned teleports
This commit is contained in:
1 parent
2bcffa5131
commit
9d4a862b7d
2 files changed
+72
-1
No files matched your search
@@ -641,12 +641,24 @@ bool ClientlessTravelGraphMgr::PlanAdaptiveRoute(
|
||||
break;
|
||||
}
|
||||
|
||||
// VCORE_C816_PORTAL_MOUNT_GUARD: a source node is not ordinary
|
||||
// ground transit. Once reached during a planned route, its only legal
|
||||
// continuation is the portal edge itself. Physical AreaTriggers may
|
||||
// fire even before the route executor advances to that edge.
|
||||
bool const isPortalSource =
|
||||
current.Value.Node.rfind("portal_at_", 0) == 0 &&
|
||||
current.Value.Node.size() >= 7 &&
|
||||
current.Value.Node.compare(current.Value.Node.size() - 7, 7, "_source") == 0;
|
||||
bool const portalArrival = isPortalSource && previous.find(currentKey) != previous.end();
|
||||
|
||||
// Persistent TravelGraph edges always reset the bridge guard.
|
||||
auto edgeItr = _edges.find(current.Value.Node);
|
||||
if (edgeItr != _edges.end())
|
||||
{
|
||||
for (ClientlessTravelEdge const& edge : edgeItr->second)
|
||||
{
|
||||
if (portalArrival && edge.Type != "portal")
|
||||
continue;
|
||||
if (blockedEdgeIds && edge.DatabaseId && blockedEdgeIds->count(edge.DatabaseId))
|
||||
continue;
|
||||
|
||||
@@ -673,7 +685,7 @@ bool ClientlessTravelGraphMgr::PlanAdaptiveRoute(
|
||||
// local bridge. This prevents MMAP from silently becoming a long-range
|
||||
// planner while still allowing unlimited bridges over a long journey
|
||||
// when real transport/ground edges lie between them.
|
||||
if (current.Value.LastWasBridge)
|
||||
if (current.Value.LastWasBridge || portalArrival)
|
||||
continue;
|
||||
|
||||
ClientlessTravelNode const& from = _nodes.at(current.Value.Node);
|
||||
@@ -754,6 +766,13 @@ bool ClientlessTravelGraphMgr::PlanAdaptiveRoute(
|
||||
continue;
|
||||
|
||||
ClientlessTravelNode const& node = _nodes.at(pair.second.Node);
|
||||
// Never terminate a partial journey on an unintended trigger source.
|
||||
bool const stopAtPortalSource = node.Key.rfind("portal_at_", 0) == 0 &&
|
||||
node.Key.size() >= 7 &&
|
||||
node.Key.compare(node.Key.size() - 7, 7, "_source") == 0 &&
|
||||
node.Key != destinationNode;
|
||||
if (stopAtPortalSource)
|
||||
continue;
|
||||
if (node.MapId != destination.MapId)
|
||||
continue;
|
||||
|
||||
@@ -779,6 +798,12 @@ bool ClientlessTravelGraphMgr::PlanAdaptiveRoute(
|
||||
if (distItr == distance.end() || !std::isfinite(distItr->second))
|
||||
continue;
|
||||
|
||||
ClientlessTravelNode const& candidateNode = _nodes.at(pair.second.Node);
|
||||
if (candidateNode.Key != destinationNode &&
|
||||
candidateNode.Key.rfind("portal_at_", 0) == 0 &&
|
||||
candidateNode.Key.size() >= 7 &&
|
||||
candidateNode.Key.compare(candidateNode.Key.size()-7, 7, "_source") == 0)
|
||||
continue;
|
||||
uint32 const hops = persistentHops[pair.first];
|
||||
if (hops > bestPersistentHops ||
|
||||
(hops == bestPersistentHops && distItr->second < bestCost))
|
||||
|
||||
Reference in new issue
Block a user