X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FInstrumentation%2Fdme.cxx;h=bcea965d83b596c766f49a772f4d50406e6f428b;hb=caf0138ab35b03bbe7bf367ff2222d0a31be3157;hp=d8d14a5a22078598760ce44a68bbb8bd3bdd0b96;hpb=312447c565ec410f52353ba22d305cf470e9ba33;p=flightgear.git diff --git a/src/Instrumentation/dme.cxx b/src/Instrumentation/dme.cxx index d8d14a5a2..bcea965d8 100644 --- a/src/Instrumentation/dme.cxx +++ b/src/Instrumentation/dme.cxx @@ -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.