From ae50c054a9007b98f1a8dafe6d589d0b4cab8873 Mon Sep 17 00:00:00 2001 From: James Turner Date: Mon, 16 Aug 2010 17:10:12 +0100 Subject: [PATCH] Fix crashes (activating the route-manager) with a default GPS. --- src/Instrumentation/gps.cxx | 2 +- src/Instrumentation/instrument_mgr.cxx | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Instrumentation/gps.cxx b/src/Instrumentation/gps.cxx index 9ebe8d6ea..71e3becbd 100644 --- a/src/Instrumentation/gps.cxx +++ b/src/Instrumentation/gps.cxx @@ -332,7 +332,7 @@ GPS::bind() tie(_gpsNode, "desired-course-deg", SGRawValueMethods (*this, &GPS::getDesiredCourse, NULL)); - _desiredCourseNode = _gpsNode->getChild("desired-course-deg"); + _desiredCourseNode = _gpsNode->getChild("desired-course-deg", 0, true); tieSGGeodReadOnly(_gpsNode, _indicated_pos, "indicated-longitude-deg", "indicated-latitude-deg", "indicated-altitude-ft"); diff --git a/src/Instrumentation/instrument_mgr.cxx b/src/Instrumentation/instrument_mgr.cxx index b85f191ae..2e3f21e3f 100644 --- a/src/Instrumentation/instrument_mgr.cxx +++ b/src/Instrumentation/instrument_mgr.cxx @@ -92,6 +92,7 @@ void FGInstrumentMgr::init() SGPropertyNode_ptr nd(new SGPropertyNode); nd->setStringValue("name", "gps"); nd->setIntValue("number", 0); + _instruments.push_back("gps[0]"); set_subsystem("gps[0]", new GPS(nd)); } -- 2.39.5