mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Don't order transports for incapable factions.
If these orders can't be fulfilled for the faction it will prevent the faction from ordering any non-reserve aircraft since transports are given priority after reserve missions, and they'll never be fulfillable. As such, no non-reserve aircraft will ever be purchased for factions without transport aircraft. Factions without transport aircraft are screwed in other ways, but this will fix their air planning for campaigns that aren't dependent on airlift.
This commit is contained in:
@@ -368,6 +368,13 @@ class AirWing:
|
||||
def squadrons_for(self, aircraft: AircraftType) -> Sequence[Squadron]:
|
||||
return self.squadrons[aircraft]
|
||||
|
||||
def can_auto_plan(self, task: FlightType) -> bool:
|
||||
try:
|
||||
next(self.auto_assignable_for_task(task))
|
||||
return True
|
||||
except StopIteration:
|
||||
return False
|
||||
|
||||
def auto_assignable_for_task(self, task: FlightType) -> Iterator[Squadron]:
|
||||
for squadron in self.iter_squadrons():
|
||||
if squadron.can_auto_assign(task):
|
||||
|
||||
@@ -592,7 +592,10 @@ class PendingTransfers:
|
||||
|
||||
def order_airlift_assets(self) -> None:
|
||||
for control_point in self.game.theater.controlpoints:
|
||||
self.order_airlift_assets_at(control_point)
|
||||
if self.game.air_wing_for(control_point.captured).can_auto_plan(
|
||||
FlightType.TRANSPORT
|
||||
):
|
||||
self.order_airlift_assets_at(control_point)
|
||||
|
||||
@staticmethod
|
||||
def desired_airlift_capacity(control_point: ControlPoint) -> int:
|
||||
|
||||
Reference in New Issue
Block a user