mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
fix(flights): read a 359.6° track as 0° in the voice context, not 360°
The voice context records for a selected flight or military contact rounded the track without wrapping, so a contact on 359.5° or more was described to the assistant as heading "360°". Both now wrap after rounding: 359.6° reads "0°", 359.4° still reads "359°".
This commit is contained in:
1 parent
a4d3701c3c
commit
ac0e124a67
5 files changed
+52
-3
No files matched your search
@@ -119,8 +119,9 @@ export function createTracking({
|
||||
speed: Number.isFinite(described.velocityMps)
|
||||
? `${Math.round(described.velocityMps * 1.944)} kt`
|
||||
: '',
|
||||
// 359.5° and above rounds to north; modulo keeps it from reading 360°.
|
||||
heading: Number.isFinite(described.track)
|
||||
? `${Math.round(described.track)}°`
|
||||
? `${Math.round(described.track) % 360}°`
|
||||
: '',
|
||||
icao24,
|
||||
// Honesty cue: the contact is coasting on dead reckoning, so the
|
||||
|
||||
Reference in new issue
Block a user