From: curt Date: Mon, 9 Oct 2000 21:17:39 +0000 (+0000) Subject: Fixed a small bug in the engine lookup of bfi that is currently crashing X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b2d7a4e27ac99f449931f8e4f151c25a9dc81d40;p=flightgear.git 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. --- 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(); + } }