diff --git a/OSM_Regions/RegionLoader.cs b/OSM_Regions/RegionLoader.cs index 7d7abff..2669556 100644 --- a/OSM_Regions/RegionLoader.cs +++ b/OSM_Regions/RegionLoader.cs @@ -61,11 +61,15 @@ public class RegionLoader(float regionSize, string? importFolderPath = null, ILo { ulong node1Id = w.NodeIds[i - 1]; ulong node2Id = w.NodeIds[i]; - if (ret.Nodes.TryGetValue(node1Id, out Graph.Node? node1) && ret.Nodes.TryGetValue(node2Id, out Graph.Node? node2)) + if (ret.Nodes.TryGetValue(node1Id, out Graph.Node? node1)) { - node1.Neighbors.TryAdd(node2Id, w.ID); - node2.Neighbors.TryAdd(node1Id, w.ID); //TODO add oneway checks + node1.Neighbors.TryAdd(node2Id, w.ID); + } + if (ret.Nodes.TryGetValue(node2Id, out Graph.Node? node2)) + { + //TODO add oneway checks + node2.Neighbors.TryAdd(node1Id, w.ID); } } }