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

@@ -178,7 +178,7 @@ class AircraftAllocator:
aircraft, task
)
for squadron in squadrons:
if squadron.number_of_available_pilots >= flight.num_aircraft:
if squadron.can_provide_pilots(flight.num_aircraft):
inventory.remove_aircraft(aircraft, flight.num_aircraft)
return airfield, squadron
return None