mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Avoid generating/planning flights without an operational runway
This commit is contained in:
parent
7eb652b970
commit
efd2c40cfc
@ -108,10 +108,17 @@ class AircraftGenerator:
|
||||
self._reserve_frequencies_and_tacan(ato)
|
||||
|
||||
for package in reversed(sorted(ato.packages, key=lambda x: x.time_over_target)):
|
||||
logging.info(f"Generating package for target: {package.target.name}")
|
||||
if not package.flights:
|
||||
continue
|
||||
for flight in package.flights:
|
||||
if flight.alive:
|
||||
if not flight.squadron.location.runway_is_operational():
|
||||
logging.warning(
|
||||
f"Runway not operational, skipping flight: {flight.flight_type}"
|
||||
)
|
||||
flight.return_pilots_and_aircraft()
|
||||
continue
|
||||
logging.info(f"Generating flight: {flight.unit_type}")
|
||||
group = self.create_and_configure_flight(
|
||||
flight, country, dynamic_runways
|
||||
|
||||
@ -48,7 +48,9 @@ class SquadronSelector(QComboBox):
|
||||
return
|
||||
|
||||
for squadron in self.air_wing.squadrons_for(aircraft):
|
||||
if task in squadron.mission_types and squadron.untasked_aircraft:
|
||||
valid_task = task in squadron.mission_types
|
||||
runway_operational = squadron.location.runway_is_operational()
|
||||
if valid_task and squadron.untasked_aircraft and runway_operational:
|
||||
self.addItem(f"{squadron.location}: {squadron}", squadron)
|
||||
|
||||
if self.count() == 0:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user