X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FInstrumentation%2Fheading_indicator.cxx;h=2cbbb9f2469b31e9fbf2dd39e318d24a17d8d3fa;hb=19e716397136f25e11187bcc025d13eeaeac346c;hp=f7899b7bcb90294e76ee5bdd7351c885380adc3a;hpb=b1b4b7ecf48c4420d4445979c36cbf3f80be616a;p=flightgear.git diff --git a/src/Instrumentation/heading_indicator.cxx b/src/Instrumentation/heading_indicator.cxx index f7899b7bc..2cbbb9f24 100644 --- a/src/Instrumentation/heading_indicator.cxx +++ b/src/Instrumentation/heading_indicator.cxx @@ -3,6 +3,10 @@ // // This file is in the Public Domain and comes with no warranty. +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #include #include #include @@ -13,6 +17,7 @@ #include
#include
+#include HeadingIndicator::HeadingIndicator ( SGPropertyNode *node ) : @@ -33,7 +38,10 @@ HeadingIndicator::init () branch = "/instrumentation/" + _name; SGPropertyNode *node = fgGetNode(branch.c_str(), _num, true ); - _offset_node = node->getChild("offset-deg", 0, true); + if( NULL == (_offset_node = node->getChild("offset-deg", 0, false)) ) { + _offset_node = node->getChild("offset-deg", 0, true); + _offset_node->setDoubleValue( -globals->get_mag()->get_magvar() * SGD_RADIANS_TO_DEGREES ); + } _heading_in_node = fgGetNode("/orientation/heading-deg", true); _suction_node = fgGetNode(_suction.c_str(), true); _heading_out_node = node->getChild("indicated-heading-deg", 0, true);