1
0
Fork 0

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.
This commit is contained in:
curt 2000-10-09 21:17:39 +00:00
parent b85ea575a3
commit b2d7a4e27a

View file

@ -691,8 +691,11 @@ FGBFI::getRPM ()
void void
FGBFI::setRPM (double rpm) FGBFI::setRPM (double rpm)
{ {
if (getRPM() != rpm) if ( current_aircraft.fdm_state->get_engine(0) != NULL ) {
current_aircraft.fdm_state->get_engine(0)->set_RPM( rpm ); if (getRPM() != rpm) {
current_aircraft.fdm_state->get_engine(0)->set_RPM( rpm );
}
}
} }
@ -702,7 +705,9 @@ FGBFI::setRPM (double rpm)
double double
FGBFI::getEGT () 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();
}
} }