From 9bd0be20a67a5ef9e6f157254528e96c710e2856 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Sun, 9 Oct 2022 17:37:55 -0700 Subject: [PATCH] Don't allow helicopters at non-FARP FOBs. Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2378. --- changelog.md | 1 + game/theater/controlpoint.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 5578d577..ad738234 100644 --- a/changelog.md +++ b/changelog.md @@ -35,6 +35,7 @@ Saves from 5.x are not compatible with 6.0. * **[Mission Generation]** Fixed adding additional mission types for a squadron causing error messages when the mission type is not supported by the aircraft type by default * **[Mission Generation]** AAA ground units now spawn correctly at the frontline * **[Modding]** Loadouts with invalid weapons (typically new DCS weapons not yet available in Liberation) will be ignored rather than causing an error. +* **[Squadrons]** Helicopter squadrons can no longer be assigned to FOBs that are not FARPs. * **[UI]** Fixed and issue where the liberation main exe was still running after application close. * **[UI]** Disable player slots for non-flyable aircraft. diff --git a/game/theater/controlpoint.py b/game/theater/controlpoint.py index bb162d76..8727ff00 100644 --- a/game/theater/controlpoint.py +++ b/game/theater/controlpoint.py @@ -1432,7 +1432,10 @@ class Fob(ControlPoint): return len(self.helipads) def can_operate(self, aircraft: AircraftType) -> bool: - return aircraft.helicopter + # FOBs and FARPs are the same class, distinguished only by non-FARP FOBs having + # zero parking. + # https://github.com/dcs-liberation/dcs_liberation/issues/2378 + return aircraft.helicopter and self.total_aircraft_parking > 0 @property def heading(self) -> Heading: