From 1f70c4c1c5bb6075c4a4fde8b60126fd70744799 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20Kl=C3=BCnder?= Date: Sun, 29 Dec 2024 00:39:03 +0100 Subject: [PATCH] hopefully this helps? --- src/c3nav/routing/locator.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/c3nav/routing/locator.py b/src/c3nav/routing/locator.py index 63b97d7b..2eb32d35 100644 --- a/src/c3nav/routing/locator.py +++ b/src/c3nav/routing/locator.py @@ -246,9 +246,17 @@ 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) + deduplicized_scan_data_in_the_same_room = [] + already_got = set() + for peer_id, value in scan_data_in_the_same_room: + key = tuple(self.peers[peer_id].xyz) + if key in already_got: + continue + deduplicized_scan_data_in_the_same_room.append((peer_id, value)) + 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: + if not the_sum: point = space.point return CustomLocation( level=router.levels[space.level_id],