diff --git a/src/c3nav/routing/locator.py b/src/c3nav/routing/locator.py index 436a9b0c..63b97d7b 100644 --- a/src/c3nav/routing/locator.py +++ b/src/c3nav/routing/locator.py @@ -246,7 +246,9 @@ class Locator: (peer_id, value) for peer_id, value in scan_data_we_can_use if self.peers[peer_id].space_id == space_id ], key=lambda a: -a[1].rssi) - if len(scan_data_in_the_same_room) == 1: + the_sum = sum((value.rssi + 90) for peer_id, value in scan_data_in_the_same_room[:3]) + + if len(scan_data_in_the_same_room) == 1 or not the_sum: point = space.point return CustomLocation( level=router.levels[space.level_id], @@ -256,8 +258,6 @@ class Locator: icon='my_location' ) else: - the_sum = sum((value.rssi+90) for peer_id, value in scan_data_in_the_same_room[:3]) - x = 0 y = 0 for peer_id, value in scan_data_in_the_same_room[:3]: