WIP: checkpoint AdventureBot intents and unfinished profession implementation

This commit is contained in:
Nico committed 2026-10-27 17:02:01 +01:00
1 parent 119d63ed1c
commit 722b513ee0
83 files changed
+11946 -199

No files matched your search

@@ -497,6 +497,12 @@ bool ClientlessTravelGraphMgr::FindNearestNodeToPosition(
return !nodeKey.empty();
}
ClientlessTravelNode const* ClientlessTravelGraphMgr::FindNode(std::string const& key) const
{
auto const it = _nodes.find(key);
return it == _nodes.end() ? nullptr : &it->second;
}
bool ClientlessTravelGraphMgr::PlanAdaptiveRoute(
Player const* player,
std::string const& destinationNode,
@@ -860,6 +866,7 @@ bool ClientlessTravelGraphMgr::PlanAdaptiveRoute(
struct ExitCandidate
{
std::string FromNode;
std::string ToNode;
uint32 EdgeId = 0;
bool Reverse = false;
uint32 EndIndex = 0; // in execution-direction original road points
@@ -933,13 +940,16 @@ bool ClientlessTravelGraphMgr::PlanAdaptiveRoute(
continue;
ExitCandidate candidate;
candidate.FromNode = edge.FromNode;
candidate.ToNode = edge.ToNode;
candidate.EdgeId = edge.DatabaseId;
candidate.Reverse = edge.Reverse;
candidate.EndIndex = i;
candidate.RoadCost = edge.Cost * (travelled / totalLength);
candidate.DistanceSq = dsq;
candidate.Point = point;
candidate.LocalCost = locationGoal && dsq <= locationAccessRadius*locationAccessRadius
bool const groundExitExhausted = blockedBridgeKeys &&
blockedBridgeKeys->count("ground_exit_edge:" + identity);
candidate.LocalCost = locationGoal && !groundExitExhausted && dsq <= locationAccessRadius*locationAccessRadius
? std::sqrt(dsq) : std::numeric_limits<float>::infinity();
ClientlessTravelNode exitNode;
exitNode.MapId=point.MapId;exitNode.X=point.X;exitNode.Y=point.Y;exitNode.Z=point.Z;
@@ -1603,6 +1613,7 @@ bool ClientlessTravelGraphMgr::PlanAdaptiveRoute(
route.clear();
return false;
}
route.back().GroundContinuationNode = route.back().NodeKey;
route.back().GroundEndIndex = int32(exit.EndIndex);
route.back().NodeKey = "virtual_ground_exit";
route.back().MapId = exit.Point.MapId;
@@ -1635,6 +1646,7 @@ bool ClientlessTravelGraphMgr::PlanAdaptiveRoute(
end.EdgeDatabaseId = exit.EdgeId;
end.EdgeReverse = exit.Reverse;
end.GroundEndIndex = int32(exit.EndIndex);
end.GroundContinuationNode = exit.ToNode;
end.MapId = exit.Point.MapId;
end.X = exit.Point.X;
end.Y = exit.Point.Y;