There was an error while loading. Please reload this page.
1 parent fd2119f commit 1455dd1Copy full SHA for 1455dd1
py2d/Navigation.py
@@ -109,17 +109,27 @@ def get_path_rec(i,j):
109
return []
110
111
d = self.get_data(i,j)[1]
112
+
113
if d == j:
114
return [j]
115
116
+ elif d == None:
117
+ return None
118
119
else:
120
return get_path_rec(i,d) + get_path_rec(d,j)
121
122
i = self._polygons.index(start)
123
j = self._polygons.index(stop)
124
- out = [i] + get_path_rec(i,j)
125
+ path = get_path_rec(i,j)
126
127
+ if path == None:
128
129
130
+ path = [i] + path
131
- return NavPath(self, [self._polygons[i] for i in out])
132
+ return NavPath(self, [self._polygons[p] for p in path])
133
134
def get_data(self, i, j):
135
return self._nav_data[i][j]
0 commit comments