From a74efc3706f465d958aadec6a3d6cd088ca50880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Laura=20Kl=C3=BCnder?= Date: Fri, 27 Dec 2024 20:20:54 +0100 Subject: [PATCH] filter out peer_ids with no distance in locate_range --- src/c3nav/routing/locator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/c3nav/routing/locator.py b/src/c3nav/routing/locator.py index 5428c9da..ef058060 100644 --- a/src/c3nav/routing/locator.py +++ b/src/c3nav/routing/locator.py @@ -242,7 +242,7 @@ class Locator: return norm def locate_range(self, scan_data: ScanData, permissions=None, orig_addr=None): - peer_ids = tuple(i for i in scan_data if i < len(self.xyz)) + peer_ids = tuple(i for i, item in scan_data.items() if i < len(self.xyz) and item.distance) if len(peer_ids) < 3: # can't get a good result from just two beacons