Only allow to start a route on streets
This commit is contained in:
parent
d24904c2d0
commit
8f9d5c254a
@ -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) {
|
for (l = solver->nodes; l != NULL; l = l->next) {
|
||||||
node = (struct dijkstra_node*) l->data;
|
node = (struct dijkstra_node*) l->data;
|
||||||
|
if (node->layer->type != STREET)
|
||||||
|
continue;
|
||||||
distance = dijkstra_position_get_distance(position, &node->position);
|
distance = dijkstra_position_get_distance(position, &node->position);
|
||||||
if (!closest_node || distance < closest_distance) {
|
if (!closest_node || distance < closest_distance) {
|
||||||
closest_node = node;
|
closest_node = node;
|
||||||
|
Loading…
Reference in New Issue
Block a user