restrict to spaces the user can actually see

This commit is contained in:
Laura Klünder 2017-12-27 11:48:37 +01:00
parent 0a6682946e
commit 06ea24bf10

View file

@ -326,7 +326,7 @@ class Router:
continue
if self.spaces[space].geometry_prep.contains(point):
return self.spaces[space]
spaces = (self.spaces[space] for space in level.spaces)
spaces = (self.spaces[space] for space in level.spaces if space not in excluded_spaces)
spaces = ((space, space.geometry.distance(point)) for space in spaces)
spaces = tuple((space, distance) for space, distance in spaces if distance < 0.5)
if not spaces: