From b2d7a4e27ac99f449931f8e4f151c25a9dc81d40 Mon Sep 17 00:00:00 2001 From: curt Date: Mon, 9 Oct 2000 21:17:39 +0000 Subject: [PATCH] Fixed a small bug in the engine lookup of bfi that is currently crashing with jsbsim since no engine is currently created. This will all have to be revamped in the future, but jsbsim has the structure for doing engines so that is good. --- src/Main/bfi.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Main/bfi.cxx b/src/Main/bfi.cxx index 3b4ec8c92..2b9945057 100644 --- a/src/Main/bfi.cxx +++ b/src/Main/bfi.cxx @@ -691,8 +691,11 @@ FGBFI::getRPM () void FGBFI::setRPM (double rpm) { - if (getRPM() != rpm) - current_aircraft.fdm_state->get_engine(0)->set_RPM( rpm ); + if ( current_aircraft.fdm_state->get_engine(0) != NULL ) { + if (getRPM() != rpm) { + current_aircraft.fdm_state->get_engine(0)->set_RPM( rpm ); + } + } } @@ -702,7 +705,9 @@ FGBFI::setRPM (double rpm) double FGBFI::getEGT () { - return current_aircraft.fdm_state->get_engine(0)->get_EGT(); + if ( current_aircraft.fdm_state->get_engine(0) != NULL ) { + return current_aircraft.fdm_state->get_engine(0)->get_EGT(); + } } -- 2.39.5