]> git.mxchange.org Git - flightgear.git/commitdiff
GPS: work around aircraft with missing power.
authorJames Turner <zakalawe@mac.com>
Sun, 16 Jun 2013 21:21:41 +0000 (22:21 +0100)
committerJames Turner <zakalawe@mac.com>
Sun, 16 Jun 2013 21:21:41 +0000 (22:21 +0100)
This restores compatibility with 2.10 and previous versions,
where even explicit (non default) GPS ignores power requirements.

src/Instrumentation/gps.cxx

index e38a1d04bf1891204c91f6b01161a1d74c7466e7..700b2aab111015fd74758f6e9b07a53ad7330378 100644 (file)
@@ -287,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;
     }