From af70818299178186f7bfd8364b8ba80972499970 Mon Sep 17 00:00:00 2001 From: zhexu14 <64713351+zhexu14@users.noreply.github.com> Date: Wed, 6 Nov 2024 22:22:17 +1100 Subject: [PATCH 1/2] Release callsigns when deleting flights --- game/commander/packagebuilder.py | 1 + 1 file changed, 1 insertion(+) diff --git a/game/commander/packagebuilder.py b/game/commander/packagebuilder.py index ad20eb72e..906ab7e10 100644 --- a/game/commander/packagebuilder.py +++ b/game/commander/packagebuilder.py @@ -104,4 +104,5 @@ def release_planned_aircraft(self) -> None: """Returns any planned flights to the inventory.""" flights = list(self.package.flights) for flight in flights: + self.callsign_generator.release_callsign(flight.callsign) self.package.remove_flight(flight) From cb50af4c1c4f4c18762ded59bdf0a03c275bc4e3 Mon Sep 17 00:00:00 2001 From: zhexu14 <64713351+zhexu14@users.noreply.github.com> Date: Thu, 7 Nov 2024 21:14:09 +1100 Subject: [PATCH 2/2] Handle flight.callsign is None --- game/commander/packagebuilder.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/game/commander/packagebuilder.py b/game/commander/packagebuilder.py index 906ab7e10..80bc727e2 100644 --- a/game/commander/packagebuilder.py +++ b/game/commander/packagebuilder.py @@ -104,5 +104,6 @@ def release_planned_aircraft(self) -> None: """Returns any planned flights to the inventory.""" flights = list(self.package.flights) for flight in flights: - self.callsign_generator.release_callsign(flight.callsign) + if flight.callsign is not None: + self.callsign_generator.release_callsign(flight.callsign) self.package.remove_flight(flight)