diff --git a/changelog.md b/changelog.md index 0e779108..607fb848 100644 --- a/changelog.md +++ b/changelog.md @@ -16,6 +16,7 @@ * **[Mission Planning]** Allow attack helicopters to escort other helicopters * **[UI]** Allow changing waypoint names in FlightEdit's waypoints tab * **[Waypoints]** Allow user to add navigation waypoints where possible without degrading to a custom flight-plan +* **[Campaign Management]** Improve squadron retreat logic to account for parking-slot sizes ## Fixes * **[Mission Generation]** Anti-ship strikes should use "group attack" in their attack-task diff --git a/game/theater/controlpoint.py b/game/theater/controlpoint.py index c78375c4..b49655ea 100644 --- a/game/theater/controlpoint.py +++ b/game/theater/controlpoint.py @@ -842,6 +842,12 @@ class ControlPoint(MissionTarget, SidcDescribable, ABC): if airbase.can_operate(squadron.aircraft): overfull.append(airbase) continue + elif isinstance(airbase, Airfield): + dcs_unit_type = squadron.aircraft.dcs_unit_type + free_slots = airbase.airport.free_parking_slots(dcs_unit_type) + if len(free_slots) < squadron.owned_aircraft or len(free_slots) == 0: + overfull.append(airbase) + continue if squadron.operates_from(airbase): # Has room, is a preferred base type for this squadron, and is the