]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/dme.cxx
NavDisplay enhancements for Syd.
[flightgear.git] / src / Instrumentation / dme.cxx
index d8d14a5a22078598760ce44a68bbb8bd3bdd0b96..bcea965d83b596c766f49a772f4d50406e6f428b 100644 (file)
@@ -119,8 +119,17 @@ DME::update (double delta_time_sec)
     if (_time_before_search_sec < 0) {
         _time_before_search_sec = 1.0;
 
-        _navrecord = globals->get_dmelist()->findByFreq( frequency_mhz,
-            globals->get_aircraft_position());
+        if( fgGetBool( "/sim/realism/dme-fallback-to-loc", true ) ) {
+            if( NULL == (_navrecord = globals->get_loclist()->findByFreq( frequency_mhz,
+                globals->get_aircraft_position())) ) {
+
+                _navrecord = globals->get_dmelist()->findByFreq( frequency_mhz,
+                    globals->get_aircraft_position());
+            }
+        } else {
+            _navrecord = globals->get_dmelist()->findByFreq( frequency_mhz,
+                globals->get_aircraft_position());
+        }
     }
 
     // If it's off, don't bother.