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:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user