From 16bf10b333d6dbeefdeb2fe6782db8088ee75f79 Mon Sep 17 00:00:00 2001 From: James Turner Date: Mon, 28 Jun 2021 12:13:56 +0100 Subject: [PATCH] Avoid Marker-beacon spam on FDM NaN case Check and bail out of marker beacon search if we are in NaN-land; this should making it easier to trace the cause of the NaNs. --- src/Instrumentation/marker_beacon.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Instrumentation/marker_beacon.cxx b/src/Instrumentation/marker_beacon.cxx index 816017a46..902ae20ad 100644 --- a/src/Instrumentation/marker_beacon.cxx +++ b/src/Instrumentation/marker_beacon.cxx @@ -297,6 +297,10 @@ void FGMarkerBeacon::search() _time_before_search_sec = 0.5; const SGGeod pos = globals->get_aircraft_position(); + if (!pos.isValid()) { + // avoid error flood when core positions goes wrong + return; + } // get closest marker beacon - within a 1nm cutoff BeaconFilter filter;