Skip to content

Commit

Permalink
fixed wrong altitude filter condition
Browse files Browse the repository at this point in the history
  • Loading branch information
b3nn0 committed Jul 5, 2019
1 parent 60cda07 commit 79a9bd9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main/traffic.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down

0 comments on commit 79a9bd9

Please sign in to comment.