mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-24 23:49:29 -04:00
Core/Waypoints: Refactor to split data into path and node related info in db (#29506)
This commit is contained in:
@@ -2066,17 +2066,17 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
for (uint32 pathId : waypoints)
|
||||
{
|
||||
WaypointPath const* path = sWaypointMgr->GetPath(pathId);
|
||||
if (!path || path->nodes.empty())
|
||||
if (!path || path->Nodes.empty())
|
||||
continue;
|
||||
|
||||
for (WaypointNode const& waypoint : path->nodes)
|
||||
for (WaypointNode const& waypoint : path->Nodes)
|
||||
{
|
||||
float distamceToThisNode = creature->GetDistance(waypoint.x, waypoint.y, waypoint.z);
|
||||
if (distamceToThisNode < distanceToClosest)
|
||||
float distanceToThisNode = creature->GetDistance(waypoint.X, waypoint.Y, waypoint.Z);
|
||||
if (distanceToThisNode < distanceToClosest)
|
||||
{
|
||||
distanceToClosest = distamceToThisNode;
|
||||
distanceToClosest = distanceToThisNode;
|
||||
closest.first = pathId;
|
||||
closest.second = waypoint.id;
|
||||
closest.second = waypoint.Id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user