Merge branch 'develop' of https://github.com/khopa/dcs_liberation into develop

This commit is contained in:
Khopa 2020-11-10 23:48:45 +01:00
commit 818c679d4f

View File

@ -1158,21 +1158,30 @@ class AircraftConflictGenerator:
self.flights[-1].waypoints = [takeoff_point] + flight.points self.flights[-1].waypoints = [takeoff_point] + flight.points
self._setup_custom_payload(flight, group) self._setup_custom_payload(flight, group)
def should_delay_flight(self, flight: Flight,
start_time: timedelta) -> bool:
if start_time.total_seconds() <= 0:
return False
if not flight.client_count:
return True
return not self.settings.never_delay_player_flights
def set_takeoff_time(self, waypoint: FlightWaypoint, package: Package, def set_takeoff_time(self, waypoint: FlightWaypoint, package: Package,
flight: Flight, group: FlyingGroup) -> None: flight: Flight, group: FlyingGroup) -> None:
estimator = TotEstimator(package) estimator = TotEstimator(package)
start_time = estimator.mission_start_time(flight) start_time = estimator.mission_start_time(flight)
if flight.client_count and not self.settings.never_delay_player_flights: if self.should_delay_flight(flight, start_time):
if start_time.total_seconds() > 0: if self.should_activate_late(flight):
if self.should_activate_late(flight): # Late activation causes the aircraft to not be spawned
# Late activation causes the aircraft to not be spawned # until triggered.
# until triggered. self.set_activation_time(flight, group, start_time)
self.set_activation_time(flight, group, start_time) elif flight.start_type == "Cold":
elif flight.start_type == "Cold": # Setting the start time causes the AI to wait until the
# Setting the start time causes the AI to wait until the # specified time to begin their startup sequence.
# specified time to begin their startup sequence. self.set_startup_time(flight, group, start_time)
self.set_startup_time(flight, group, start_time)
# And setting *our* waypoint TOT causes the takeoff time to show up in # And setting *our* waypoint TOT causes the takeoff time to show up in
# the player's kneeboard. # the player's kneeboard.