From 79a9bd963c3d0757cf3a77d92d8587dac82cb7a4 Mon Sep 17 00:00:00 2001 From: Adrian Batzill Date: Fri, 5 Jul 2019 16:06:23 +0100 Subject: [PATCH] fixed wrong altitude filter condition --- main/traffic.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main/traffic.go b/main/traffic.go index f33dad1b6..25a4a49da 100644 --- a/main/traffic.go +++ b/main/traffic.go @@ -221,7 +221,7 @@ func sendTrafficUpdates() { // As bearingless targets, we show the closest estimated traffic that is between +-3000ft if !ti.Position_valid && (bestEstimate.DistanceEstimated == 0 || ti.DistanceEstimated < bestEstimate.DistanceEstimated) { - if bestEstimate.Alt > 0 && math.Abs(float64(bestEstimate.Alt) - float64(currAlt)) < 3000 { + if ti.Alt != 0 && math.Abs(float64(ti.Alt) - float64(currAlt)) < 3000 { bestEstimate = ti } }