Run aircraft_generator.generate_packages() only once per ATO, instead of multiple times. Fixed the duplicated flights issue.

This commit is contained in:
MetalStormGhost 2023-09-18 18:23:03 +03:00
parent 91cfff58d9
commit 95bac8ec17

View File

@ -221,19 +221,21 @@ class PretenseMissionGenerator(MissionGenerator):
ato, ato,
) )
for cp in self.game.theater.controlpoints: ato = self.game.blue.ato
if cp.captured: country = self.p_country
ato = self.game.blue.ato aircraft_generator.generate_packages(
country = self.p_country country,
else: ato,
ato = self.game.red.ato tgo_generator.runways,
country = self.e_country )
aircraft_generator.generate_packages( ato = self.game.red.ato
country, country = self.e_country
ato, aircraft_generator.generate_packages(
tgo_generator.runways, country,
) ato,
tgo_generator.runways,
)
self.mission_data.flights = aircraft_generator.flights self.mission_data.flights = aircraft_generator.flights