From 28c775af60129559f3ec0222307163a3e1732011 Mon Sep 17 00:00:00 2001 From: Benjamin Fischer Date: Fri, 25 Mar 2022 01:15:06 +0100 Subject: [PATCH] Fix can_operate for airfields without runways. cherry-pick from e9c5cac20ca1a1dbf7531bd99e83a717e949aa2e --- game/theater/controlpoint.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/game/theater/controlpoint.py b/game/theater/controlpoint.py index 207a3f4d..e7ce7647 100644 --- a/game/theater/controlpoint.py +++ b/game/theater/controlpoint.py @@ -889,7 +889,12 @@ class Airfield(ControlPoint): # TODO: Allow harrier. # Needs ground spawns just like helos do, but also need to be able to # limit takeoff weight to ~20500 lbs or it won't be able to take off. - return self.runway_is_operational() + + # return false if aircraft is fixed wing and airport has no runways + if not aircraft.helicopter and not self.airport.runways: + return False + else: + return self.runway_is_operational() def mission_types(self, for_player: bool) -> Iterator[FlightType]: from gen.flights.flight import FlightType