Generate packages according to TOT order (latest first, earliest last)

This makes sure that aircraft spawning in the air due to a shortage of parking spots, will have the earliest TOT possible. Flights with later TOTs should be generated first so that they remain at the airfield as OCA target.
This commit is contained in:
Raffson 2023-01-01 16:53:58 +01:00
parent 37f2e5bf3a
commit 6d0ac603f2
No known key found for this signature in database
GPG Key ID: B0402B2C9B764D99

View File

@ -104,7 +104,7 @@ class AircraftGenerator:
ato: The ATO to spawn aircraft for.
dynamic_runways: Runway data for carriers and FARPs.
"""
for package in ato.packages:
for package in reversed(sorted(ato.packages, key=lambda x: x.time_over_target)):
if not package.flights:
continue
for flight in package.flights: