From c0d347859f4270ce2b112026ddbd33c8946be1a5 Mon Sep 17 00:00:00 2001 From: James Turner Date: Sun, 31 May 2020 12:18:07 +0100 Subject: [PATCH] Ensure various properties have a value on start. Ensure /orientation/heading-magnetic-deg, etc have a type of double immediately. Showed up as a bug in the SenecaII, since the property is created but has NIL value until the first update() call. --- src/Main/fg_props.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/Main/fg_props.cxx b/src/Main/fg_props.cxx index 870c5de48..9c1cc7e18 100644 --- a/src/Main/fg_props.cxx +++ b/src/Main/fg_props.cxx @@ -418,10 +418,19 @@ FGProperties::bind () _tiedProperties.Tie("/position/longitude-string", getLongitudeString); _headingMagnetic = fgGetNode("/orientation/heading-magnetic-deg", true); + _headingMagnetic->setDoubleValue(0.0); + _trackMagnetic = fgGetNode("/orientation/track-magnetic-deg", true); + _trackMagnetic->setDoubleValue(0.0); + _magVar = fgGetNode("/environment/magnetic-variation-deg", true); + _magVar->setDoubleValue(0.0); + _trueHeading = fgGetNode("/orientation/heading-deg", true); + _trueHeading->setDoubleValue(0.0); + _trueTrack = fgGetNode("/orientation/track-deg", true); + _trueTrack->setDoubleValue(0.0); } void