From 8f9d5c254af9a156e5221e857d13a5d00f85aa5e Mon Sep 17 00:00:00 2001 From: Markus Koch Date: Mon, 8 Feb 2021 21:38:21 +0100 Subject: [PATCH] Only allow to start a route on streets --- src/dijkstragraph.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/dijkstragraph.c b/src/dijkstragraph.c index 90fa482..405936f 100644 --- a/src/dijkstragraph.c +++ b/src/dijkstragraph.c @@ -548,6 +548,8 @@ struct dijkstra_node *dijkstra_node_find_closest_node(struct dijkstra_solver *so for (l = solver->nodes; l != NULL; l = l->next) { node = (struct dijkstra_node*) l->data; + if (node->layer->type != STREET) + continue; distance = dijkstra_position_get_distance(position, &node->position); if (!closest_node || distance < closest_distance) { closest_node = node;