Separate combat as a distinct flight state.

Will be used later to simulate combat.

https://github.com/dcs-liberation/dcs_liberation/issues/1680
This commit is contained in:
Dan Albert
2021-11-07 12:17:05 -08:00
parent d9108a7ca6
commit ce4628b64f
11 changed files with 179 additions and 67 deletions

View File

@@ -40,7 +40,11 @@ class AircraftSimulation:
blue_a2a = AircraftEngagementZones.from_ato(self.game.blue.ato)
red_a2a = AircraftEngagementZones.from_ato(self.game.red.ato)
for flight in self.iter_flights():
if flight.should_halt_sim(red_a2a if flight.squadron.player else blue_a2a):
flight.check_for_combat(red_a2a if flight.squadron.player else blue_a2a)
# After updating all combat states, check for halts.
for flight in self.iter_flights():
if flight.should_halt_sim():
return True
return False