Skip to content

Commit

Permalink
Core: LocalPathingApi: Reuse output array
Browse files Browse the repository at this point in the history
  • Loading branch information
Xian55 committed Sep 20, 2023
1 parent 538d781 commit b8a9e9e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Core/PPather/LocalPathingApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,11 @@ public Vector3[] FindMapRoute(int uiMap, Vector3 mapFrom, Vector3 mapTo)
lastSave = DateTime.UtcNow;
}

Vector3[] array = new Vector3[path.locations.Count];
for (int i = 0; i < array.Length; i++)
for (int i = 0; i < path.locations.Count; i++)
{
array[i] = service.ToLocal(path.locations[i], (int)service.SearchFrom.W, uiMap);
path.locations[i] = service.ToLocal(path.locations[i], (int)service.SearchFrom.W, uiMap);
}
return array;
return path.locations.ToArray();
}

public Vector3[] FindWorldRoute(int uiMap, Vector3 worldFrom, Vector3 worldTo)
Expand Down

0 comments on commit b8a9e9e

Please sign in to comment.