Addresses #478 to clean up the angle summing functionality. (#1386)

This commit is contained in:
bgreman 2021-06-30 23:58:20 -04:00 committed by GitHub
parent c8e5cefd36
commit 9bd6f9ef47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 6 deletions

View File

@ -20,6 +20,8 @@ Saves from 4.0.0 are compatible with 4.0.1.
## Fixes ## Fixes
* **[UI]** Statistics window tick marks are now always integers. * **[UI]** Statistics window tick marks are now always integers.
* **[Flight Planning]** Fixed potential issue with angles > 360° or < 0° being generated when summing two angles.
# 4.0.0 # 4.0.0
Saves from 3.x are not compatible with 4.0. Saves from 3.x are not compatible with 4.0.

View File

@ -18,12 +18,7 @@ KPH_TO_MS = 1 / MS_TO_KPH
def heading_sum(h, a) -> int: def heading_sum(h, a) -> int:
h += a h += a
if h > 360: return h % 360
return h - 360
elif h < 0:
return 360 + h
else:
return h
def opposite_heading(h): def opposite_heading(h):