X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FInstrumentation%2Fheading_indicator_fg.cxx;h=406300f12f01b158fb1519cead55d11a6a2ad28d;hb=fe0a703a192a37b96aa4f6048c8e542c24671705;hp=960bd98ab55570157b1b706c308a25dba3615f17;hpb=edd83dd7e8fd7162ae49da6113ad797c68769f20;p=flightgear.git diff --git a/src/Instrumentation/heading_indicator_fg.cxx b/src/Instrumentation/heading_indicator_fg.cxx index 960bd98ab..406300f12 100644 --- a/src/Instrumentation/heading_indicator_fg.cxx +++ b/src/Instrumentation/heading_indicator_fg.cxx @@ -5,15 +5,24 @@ // // This file is in the Public Domain and comes with no warranty. +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #include #include #include #include -#include "heading_indicator_fg.hxx" +#include +#include + #include
-#include
+#include
+#include "heading_indicator_fg.hxx" + +using std::string; HeadingIndicatorFG::HeadingIndicatorFG ( SGPropertyNode *node ) : @@ -55,7 +64,10 @@ HeadingIndicatorFG::init () _heading_in_node = fgGetNode("/orientation/heading-deg", true); 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 ); + } _serviceable_node = node->getChild("serviceable", 0, true); _error_node = node->getChild("heading-bug-error-deg", 0, true); _nav1_error_node = node->getChild("nav1-course-error-deg", 0, true);