mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
address issue 3175 by introducing special divide by zero handling
This commit is contained in:
parent
6f1ee9561b
commit
10aee31c7d
@ -234,6 +234,7 @@ BAI/ANTISHIP/DEAD/STRIKE/BARCAP/CAS/OCA/AIR-ASSAULT (main) missions
|
|||||||
* **[Mission Generation]** Restored previous AI behavior for anti-ship missions. A DCS update caused only a single aircraft in a flight to attack. The full flight will now attack like they used to.
|
* **[Mission Generation]** Restored previous AI behavior for anti-ship missions. A DCS update caused only a single aircraft in a flight to attack. The full flight will now attack like they used to.
|
||||||
* **[Mission Generation]** Fix generation of OCA Runway missions to allow LGBs to be used.
|
* **[Mission Generation]** Fix generation of OCA Runway missions to allow LGBs to be used.
|
||||||
* **[Mission Generation]** Fixed AI flights flying far too slowly toward NAV points.
|
* **[Mission Generation]** Fixed AI flights flying far too slowly toward NAV points.
|
||||||
|
* **[Mission Generation]** Fixed "division by zero" error on mission generation when a flight has an "In-Flight" start type and starts on top of a mission waypoint.
|
||||||
* **[Modding]** Unit variants can now actually override base unit type properties.
|
* **[Modding]** Unit variants can now actually override base unit type properties.
|
||||||
* **[Plugins]** Fixed Lua errors in Skynet plugin that would occur whenever one coalition had no IADS nodes.
|
* **[Plugins]** Fixed Lua errors in Skynet plugin that would occur whenever one coalition had no IADS nodes.
|
||||||
* **[UI]** Fixed deleting waypoints in custom flight plans deleting the wrong waypoint.
|
* **[UI]** Fixed deleting waypoints in custom flight plans deleting the wrong waypoint.
|
||||||
|
|||||||
@ -29,6 +29,11 @@ class Navigating(InFlight):
|
|||||||
events.update_flight_position(self.flight, self.estimate_position())
|
events.update_flight_position(self.flight, self.estimate_position())
|
||||||
|
|
||||||
def progress(self) -> float:
|
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
|
||||||
|
|
||||||
return (
|
return (
|
||||||
self.elapsed_time.total_seconds()
|
self.elapsed_time.total_seconds()
|
||||||
/ self.total_time_to_next_waypoint.total_seconds()
|
/ self.total_time_to_next_waypoint.total_seconds()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user