From b091a2838c93c61bb93e1dd9a69cb61af8fccbe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20Kl=C3=BCnder?= Date: Sun, 25 Dec 2016 14:58:46 +0100 Subject: [PATCH] =?UTF-8?q?fix=20weird=20routing=20error.=20should=20never?= =?UTF-8?q?=20have=20worked=20anyway=E2=80=A6=20wtf=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/c3nav/routing/graph.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/c3nav/routing/graph.py b/src/c3nav/routing/graph.py index 44039517..42f452fc 100644 --- a/src/c3nav/routing/graph.py +++ b/src/c3nav/routing/graph.py @@ -286,6 +286,9 @@ class Graph: if not len(orig_points_i) or not len(dest_points_i): raise AlreadyThere() + #if set(orig_points_i) & set(dest_points_i): + # raise AlreadyThere() + add_orig_point = origin if isinstance(origin, PointLocation) else None add_dest_point = destination if isinstance(destination, PointLocation) else None @@ -371,8 +374,8 @@ class Graph: # noinspection PyTypeChecker from_point, to_point = np.argwhere(shortest_paths == distance)[0] - from_point = orig_room_points[from_point] - to_point = dest_room_points[to_point] + from_point = orig_room_points[room][from_point] + to_point = dest_room_points[room][to_point] best_route = RoomRouteSegment(room, routers, from_point, to_point).as_route() # get reachable room transfer points and their distance