mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Autoplanner will take number of pilots into account when planning purchases
- Added expected_pilots_next_turn() to Squadron. The procurement AI now correctly compares to it when evaluating if planes should be bought, instead of the maximum possible number of pilots. - Added replenish_rate method to squadron.py to prevent expected_pilots_next_turn from returning an incorrect (too large) number when replenish rate > pilots required. #1837
This commit is contained in:
@@ -185,6 +185,14 @@ class ProcurementAi:
|
||||
) -> Tuple[float, bool]:
|
||||
for squadron in squadrons:
|
||||
price = squadron.aircraft.price * quantity
|
||||
# Final check to make sure the number of aircraft won't exceed the number of available pilots
|
||||
# after fulfilling this aircraft request.
|
||||
if (
|
||||
squadron.pilot_limits_enabled
|
||||
and squadron.expected_size_next_turn + quantity
|
||||
> squadron.expected_pilots_next_turn
|
||||
):
|
||||
continue
|
||||
if price > budget:
|
||||
continue
|
||||
|
||||
|
||||
Reference in New Issue
Block a user