Core/Waypoints: Refactor to split data into path and node related info in db

Port From (https://github.com/TrinityCore/TrinityCore/commit/12186ef8573f60abeff4747da58767ee71092600)
This commit is contained in:
hondacrx
2024-02-05 17:22:55 -05:00
parent 301d3fb00d
commit 771cbadc69
15 changed files with 520 additions and 651 deletions
+6 -6
View File
@@ -2027,17 +2027,17 @@ namespace Game.AI
foreach (uint pathId in waypoints)
{
WaypointPath path = Global.WaypointMgr.GetPath(pathId);
if (path == null || path.nodes.Empty())
if (path == null || path.Nodes.Empty())
continue;
foreach (var waypoint in path.nodes)
foreach (var waypoint in path.Nodes)
{
float distToThisPath = creature.GetDistance(waypoint.x, waypoint.y, waypoint.z);
if (distToThisPath < distanceToClosest)
float distanceToThisNode = creature.GetDistance(waypoint.X, waypoint.Y, waypoint.Z);
if (distanceToThisNode < distanceToClosest)
{
distanceToClosest = distToThisPath;
distanceToClosest = distanceToThisNode;
closestPathId = pathId;
closestWaypointId = waypoint.id;
closestWaypointId = waypoint.Id;
}
}
}