Revert unnecessary change

This commit is contained in:
Raffson
2024-07-28 17:08:01 +02:00
parent 8eb30445c2
commit 5bb70626d2

View File

@@ -29,8 +29,10 @@ class Navigating(InFlight):
events.update_flight_position(self.flight, self.estimate_position())
def progress(self) -> float:
if self.total_time_to_next_waypoint.total_seconds() == 0.0:
return 99.9
# if next waypoint is very close, assume we reach it immediately to avoid divide
# by zero error
if self.total_time_to_next_waypoint.total_seconds() < 1:
return 1.0
return (
self.elapsed_time.total_seconds()
/ self.total_time_to_next_waypoint.total_seconds()