]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/gps.cxx
Support for multiple data dirs.
[flightgear.git] / src / Instrumentation / gps.cxx
index bb1e9d49064ceab8fe0599ffd26df033f248d8b6..700b2aab111015fd74758f6e9b07a53ad7330378 100644 (file)
@@ -107,6 +107,12 @@ GPS::GPS ( SGPropertyNode *node, bool defaultGPSMode) :
   
   SGPropertyNode *wp_node = _gpsNode->getChild("wp", 0, true);
   _currentWayptNode = wp_node->getChild("wp", 1, true);
+    
+#if FG_210_COMPAT
+    _searchIsRoute = false;
+    _searchHasNext = false;
+    _searchType = FGPositioned::INVALID;
+#endif
 }
 
 GPS::~GPS ()
@@ -281,7 +287,10 @@ GPS::update (double delta_time_sec)
 {
   if (!_defaultGPSMode) {
     // If it's off, don't bother.
-    if (!_serviceable_node->getBoolValue() || !_electrical_node->getBoolValue()) {
+      // check if value is defined, since many aircraft don't define an output
+      // for the GPS, but expect the default one to work.
+      bool elecOn = !_electrical_node->hasValue() || _electrical_node->getBoolValue();
+    if (!_serviceable_node->getBoolValue() || !elecOn) {
       clearOutput();
       return;
     }