Don't allow operating on broken runways.

Doesn't allow helos or harriers to do it either even though they should
be able to because we don't currently support ground spawns, which would
be needed to prevent those aircraft from using the runway. Even then, I
don't know if they can be forced to *land* vertically.

Fixes https://github.com/Khopa/dcs_liberation/issues/432
This commit is contained in:
Dan Albert
2020-11-25 18:48:07 -08:00
parent a1b64bc72d
commit 2bd673a531
11 changed files with 54 additions and 37 deletions

View File

@@ -201,7 +201,7 @@ class AircraftAllocator:
def find_aircraft_of_type(
self, flight: ProposedFlight, types: List[Type[FlyingType]],
) -> Optional[Tuple[ControlPoint, FlyingType]]:
) -> Optional[Tuple[ControlPoint, Type[FlyingType]]]:
airfields_in_range = self.closest_airfields.airfields_within(
flight.max_distance
)
@@ -210,6 +210,8 @@ class AircraftAllocator:
continue
inventory = self.global_inventory.for_control_point(airfield)
for aircraft, available in inventory.all_aircraft:
if not airfield.can_operate(aircraft):
continue
if aircraft in types and available >= flight.num_aircraft:
inventory.remove_aircraft(aircraft, flight.num_aircraft)
return airfield, aircraft
@@ -264,7 +266,7 @@ class PackageBuilder:
continue
if airfield == arrival:
continue
if not airfield.can_land(aircraft):
if not airfield.can_operate(aircraft):
continue
if isinstance(airfield, OffMapSpawn):
continue