mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fix traveltime & offsets
This commit is contained in:
parent
bcdf2ad887
commit
7d347eee94
@ -189,7 +189,6 @@ class FlightPlan(ABC, Generic[LayoutT]):
|
|||||||
|
|
||||||
for previous_waypoint, waypoint in self.edges(until=destination):
|
for previous_waypoint, waypoint in self.edges(until=destination):
|
||||||
total += self.total_time_between_waypoints(previous_waypoint, waypoint)
|
total += self.total_time_between_waypoints(previous_waypoint, waypoint)
|
||||||
total += self.travel_time_between_waypoints(previous_waypoint, waypoint)
|
|
||||||
|
|
||||||
# Trim microseconds. Our simulation tick rate is 1 second, so anything that
|
# Trim microseconds. Our simulation tick rate is 1 second, so anything that
|
||||||
# takes 100.1 or 100.9 seconds will take 100 seconds. DCS doesn't handle
|
# takes 100.1 or 100.9 seconds will take 100 seconds. DCS doesn't handle
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from game.utils import Distance, SPEED_OF_SOUND_AT_SEA_LEVEL, Speed, mach, meters
|
from game.utils import Distance, SPEED_OF_SOUND_AT_SEA_LEVEL, Speed, mach, meters
|
||||||
@ -59,4 +59,6 @@ class TotEstimator:
|
|||||||
Returns:
|
Returns:
|
||||||
The earliest possible TOT for the given flight.
|
The earliest possible TOT for the given flight.
|
||||||
"""
|
"""
|
||||||
return now + flight.flight_plan.minimum_duration_from_start_to_tot()
|
flight_time = flight.flight_plan.minimum_duration_from_start_to_tot()
|
||||||
|
offset = flight.flight_plan.tot_offset
|
||||||
|
return now + flight_time - offset
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user