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.
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 );
+ }
+ }
}
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();
+ }
}