mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fix kneeboard crash for small strike missions.
When we don't coalesce target points on the kneeboard we call add_waypoint_row multiple times, so calls after the first were using the travel time from one strike target to the next. Since they were so close that rounded down to zero and caused a divide by zero error. Update the last waypoint in add_waypoint instead.
This commit is contained in:
parent
15db12fb21
commit
5f02febb6c
@ -124,6 +124,7 @@ class FlightPlanBuilder:
|
||||
self.target_points = []
|
||||
|
||||
self.add_waypoint_row(NumberedWaypoint(waypoint_num, waypoint))
|
||||
self.last_waypoint = waypoint
|
||||
|
||||
def coalesce_target_points(self) -> None:
|
||||
if len(self.target_points) <= 4:
|
||||
@ -155,7 +156,6 @@ class FlightPlanBuilder:
|
||||
self._format_time(waypoint.waypoint.tot),
|
||||
self._format_time(waypoint.waypoint.departure_time),
|
||||
])
|
||||
self.last_waypoint = waypoint.waypoint
|
||||
|
||||
def _format_time(self, time: Optional[int]) -> str:
|
||||
if time is None:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user