X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FInstrumentation%2Fheading_indicator_fg.cxx;h=406300f12f01b158fb1519cead55d11a6a2ad28d;hb=fe0a703a192a37b96aa4f6048c8e542c24671705;hp=dfa099c51e6c4a9d1cb6a4224cf2244bd5364d17;hpb=269595a366d9285e801431bdf401b1e51ef4820d;p=flightgear.git diff --git a/src/Instrumentation/heading_indicator_fg.cxx b/src/Instrumentation/heading_indicator_fg.cxx index dfa099c51..406300f12 100644 --- a/src/Instrumentation/heading_indicator_fg.cxx +++ b/src/Instrumentation/heading_indicator_fg.cxx @@ -14,9 +14,13 @@ #include #include -#include "heading_indicator_fg.hxx" +#include +#include + #include
-#include
+#include
+ +#include "heading_indicator_fg.hxx" using std::string; @@ -60,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);