Add a feature flag for pilot limits.

This doesn't currently interact very well with the auto purchase since
the procurer might by aircraft that don't have pilots available. That
should be fixed, but for the short term we should just default to not
enabling this new feature.
This commit is contained in:
Dan Albert
2021-06-23 15:49:36 -07:00
parent 905bd05ba8
commit 3ddfc47d3a
6 changed files with 144 additions and 76 deletions

View File

@@ -299,8 +299,12 @@ class AirliftPlanner:
required,
available_aircraft,
squadron.aircraft.dcs_unit_type.group_size_max,
squadron.number_of_available_pilots,
)
# TODO: Use number_of_available_pilots directly once feature flag is gone.
# The number of currently available pilots is not relevant when pilot limits
# are disabled.
if not squadron.can_provide_pilots(flight_size):
flight_size = squadron.number_of_available_pilots
capacity = flight_size * capacity_each
if capacity < self.transfer.size: