Fix traveltime & offsets

This commit is contained in:
Raffson 2023-10-15 13:32:11 +02:00
parent bcdf2ad887
commit 7d347eee94
No known key found for this signature in database
GPG Key ID: B0402B2C9B764D99
2 changed files with 4 additions and 3 deletions

View File

@ -189,7 +189,6 @@ class FlightPlan(ABC, Generic[LayoutT]):
for previous_waypoint, waypoint in self.edges(until=destination):
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
# takes 100.1 or 100.9 seconds will take 100 seconds. DCS doesn't handle

View File

@ -1,6 +1,6 @@
from __future__ import annotations
from datetime import datetime, timedelta
from datetime import datetime
from typing import TYPE_CHECKING
from game.utils import Distance, SPEED_OF_SOUND_AT_SEA_LEVEL, Speed, mach, meters
@ -59,4 +59,6 @@ class TotEstimator:
Returns:
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