mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user