heliwatch: don't track aircrafts without altitude

This commit is contained in:
Astro 2021-11-09 16:41:20 +01:00
parent 71b534fe6e
commit c9e3581fe2
1 changed files with 4 additions and 0 deletions

View File

@ -133,6 +133,10 @@ pub fn run(host: &'static str, port: u16, locations: Locations) -> Receiver<Even
let hex = format!("{}", icao_address);
let entry = entry.read().unwrap();
if entry.altitude.is_none() {
continue;
}
if entry.altitude.map(|altitude| altitude > MAX_ALTITUDE).unwrap_or(false) ||
entry.emitter_category.as_ref().map(|category| IGNORED_CATEGORIES.contains(category)).unwrap_or(false)
{