From 9e98f05be052d17345e915452d7863c419e965a9 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Sat, 12 Sep 2020 12:27:03 -0700 Subject: [PATCH] Ensure that allocated channels are reserved. This was previously mostly working because the allocator itself was moving forward, but since each radio has its own allocator, aircraft with different radios would often get overlapping intra-flight frequencies. --- gen/radios.py | 1 + 1 file changed, 1 insertion(+) diff --git a/gen/radios.py b/gen/radios.py index 62790a4c..9462cf5d 100644 --- a/gen/radios.py +++ b/gen/radios.py @@ -183,6 +183,7 @@ class RadioRegistry: try: while (channel := next(allocator)) in self.allocated_channels: pass + self.reserve(channel) return channel except StopIteration: raise OutOfChannelsError(radio)