diff --git a/src/Network/native_ctrls.cxx b/src/Network/native_ctrls.cxx index e9267f984..6c215c6d5 100644 --- a/src/Network/native_ctrls.cxx +++ b/src/Network/native_ctrls.cxx @@ -113,10 +113,10 @@ void FGProps2NetCtrls( FGNetCtrls *net, bool honor_freezes, net->elevator_trim = node->getDoubleValue( "elevator-trim" ); net->rudder = node->getDoubleValue( "rudder" ); net->flaps = node->getDoubleValue( "flaps" ); - node = fgGetNode("/controls", true); net->flaps_power - = node->getDoubleValue( "/systems/electrical/outputs/flaps", - 1.0 ) >= 1.0; + = fgGetDouble( "/systems/electrical/outputs/flaps", 1.0 ) >= 1.0; + net->flap_motor_ok = node->getBoolValue( "flaps-serviceable" ); + net->num_engines = FGNetCtrls::FG_MAX_ENGINES; for ( i = 0; i < FGNetCtrls::FG_MAX_ENGINES; ++i ) { // Controls @@ -229,6 +229,7 @@ void FGProps2NetCtrls( FGNetCtrls *net, bool honor_freezes, htond(net->rudder); htond(net->flaps); net->flaps_power = htonl(net->flaps_power); + net->flap_motor_ok = htonl(net->flap_motor_ok); for ( i = 0; i < FGNetCtrls::FG_MAX_ENGINES; ++i ) { net->magnetos[i] = htonl(net->magnetos[i]); net->starter_power[i] = htonl(net->starter_power[i]); @@ -284,6 +285,7 @@ void FGNetCtrls2Props( FGNetCtrls *net, bool honor_freezes, htond(net->rudder); htond(net->flaps); net->flaps_power = htonl(net->flaps_power); + net->flap_motor_ok = htonl(net->flap_motor_ok); net->num_engines = htonl(net->num_engines); for ( i = 0; i < net->num_engines; ++i ) { net->magnetos[i] = htonl(net->magnetos[i]); @@ -333,8 +335,8 @@ void FGNetCtrls2Props( FGNetCtrls *net, bool honor_freezes, node->setDoubleValue( "elevator-trim", net->elevator_trim ); node->setDoubleValue( "rudder", net->rudder ); node->setDoubleValue( "flaps", net->flaps ); - fgSetBool( "/systems/electrical/outputs/flaps", net->flaps_power ); + node->setBoolValue( "flaps-serviceable", net->flap_motor_ok ); for ( i = 0; i < FGNetCtrls::FG_MAX_ENGINES; ++i ) { // Controls diff --git a/src/Network/net_ctrls.hxx b/src/Network/net_ctrls.hxx index f110c356c..54baaf0b0 100644 --- a/src/Network/net_ctrls.hxx +++ b/src/Network/net_ctrls.hxx @@ -30,7 +30,7 @@ # error This library requires C++ #endif -const int FG_NET_CTRLS_VERSION = 15; +const int FG_NET_CTRLS_VERSION = 16; // Define a structure containing the control parameters @@ -56,6 +56,7 @@ public: // Aero control faults bool flaps_power; // true = power available + bool flap_motor_ok; // Engine controls int num_engines; // number of valid engines diff --git a/src/Replay/replay.cxx b/src/Replay/replay.cxx index bbf95eb7a..38ebe9e25 100644 --- a/src/Replay/replay.cxx +++ b/src/Replay/replay.cxx @@ -315,8 +315,8 @@ static FGReplayData interpolate( double time, FGReplayData f1, FGReplayData f2 ) = weight( ctrls1.elevator_trim, ctrls2.elevator_trim, ratio ); result.ctrls.rudder = weight( ctrls1.rudder, ctrls2.rudder, ratio ); result.ctrls.flaps = weight( ctrls1.flaps, ctrls2.flaps, ratio ); - result.ctrls.flaps_power - = weight( ctrls1.flaps_power, ctrls2.flaps_power, ratio ); + result.ctrls.flaps_power = ctrls1.flaps_power; + result.ctrls.flap_motor_ok = ctrls1.flap_motor_ok; // Engine controls for ( i = 0; i < ctrls1.num_engines; ++i ) {