mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fix delays of AI flights.
Fixes https://github.com/Khopa/dcs_liberation/issues/354
This commit is contained in:
parent
7535013848
commit
623d461b06
@ -1158,13 +1158,22 @@ 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.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user