Implemented spawning of Pretense cargo aircraft. To support that, implemented a separate flight plan called PretenseCargoFlightPlan. Also, will now automatically generate transport squadrons for factions which don't have pre-defined squadrons for it, but have access to transport aircraft.

This commit is contained in:
MetalStormGhost
2023-09-16 14:36:59 +03:00
parent 4ad87aef3e
commit d965f90bb4
5 changed files with 225 additions and 22 deletions

View File

@@ -29,11 +29,8 @@ class Navigating(InFlight):
events.update_flight_position(self.flight, self.estimate_position())
def progress(self) -> float:
# 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
if self.total_time_to_next_waypoint.total_seconds() == 0.0:
return 99.9
return (
self.elapsed_time.total_seconds()
/ self.total_time_to_next_waypoint.total_seconds()