From 90e4896fdf652f0ab662ef20190dbadb03a4f492 Mon Sep 17 00:00:00 2001 From: curt Date: Mon, 3 Jan 2005 03:20:31 +0000 Subject: [PATCH] Fix a mistake in handling of engine starter property names. --- src/Network/native_ctrls.cxx | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/Network/native_ctrls.cxx b/src/Network/native_ctrls.cxx index 118555abb..9bbd1f6ea 100644 --- a/src/Network/native_ctrls.cxx +++ b/src/Network/native_ctrls.cxx @@ -103,7 +103,6 @@ void FGProps2NetCtrls( FGNetCtrls *net, bool honor_freezes, { int i; SGPropertyNode *node; - SGPropertyNode *starter; SGPropertyNode *fuelpump; SGPropertyNode *tempnode; @@ -123,9 +122,12 @@ void FGProps2NetCtrls( FGNetCtrls *net, bool honor_freezes, for ( i = 0; i < FGNetCtrls::FG_MAX_ENGINES; ++i ) { // Controls node = fgGetNode("/controls/engines/engine", i ); - starter = fgGetNode("/systems/electrical/outputs/starter", i ); fuelpump = fgGetNode("/systems/electrical/outputs/fuel-pump", i ); + tempnode = node->getChild("starter"); + if ( tempnode != NULL ) { + net->starter_power[i] = ( tempnode->getDoubleValue() >= 1.0 ); + } tempnode = node->getChild("master-bat"); if ( tempnode != NULL ) { net->master_bat[i] = tempnode->getBoolValue(); @@ -154,12 +156,6 @@ void FGProps2NetCtrls( FGNetCtrls *net, bool honor_freezes, net->fuel_pump_power[i] = 0.0; } - if ( starter != NULL ) { - net->starter_power[i] = ( starter->getDoubleValue() >= 1.0 ); - } else { - net->starter_power[i] = 0.0; - } - // Faults SGPropertyNode *faults = node->getChild( "faults", 0, true ); net->engine_ok[i] = faults->getBoolValue( "serviceable", true ); @@ -370,6 +366,7 @@ void FGNetCtrls2Props( FGNetCtrls *net, bool honor_freezes, node->getChild( "condition" ) ->setDoubleValue( net->condition[i] ); node->getChild( "magnetos" )->setDoubleValue( net->magnetos[i] ); + node->getChild( "starter" )->setDoubleValue( net->starter_power[i] ); // Faults SGPropertyNode *faults = node->getNode( "faults", true ); @@ -386,8 +383,6 @@ void FGNetCtrls2Props( FGNetCtrls *net, bool honor_freezes, fgSetBool( "/systems/electrical/outputs/fuel-pump", net->fuel_pump_power[0] ); - fgSetBool( "/systems/electrical/outputs/starter", - net->starter_power[0] ); for ( i = 0; i < FGNetCtrls::FG_MAX_TANKS; ++i ) { node = fgGetNode( "/controls/fuel/tank", i );