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:
parent
b85ea575a3
commit
b2d7a4e27a
1 changed files with 8 additions and 3 deletions
|
@ -691,8 +691,11 @@ FGBFI::getRPM ()
|
|||
void
|
||||
FGBFI::setRPM (double rpm)
|
||||
{
|
||||
if (getRPM() != 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 ()
|
||||
{
|
||||
if ( current_aircraft.fdm_state->get_engine(0) != NULL ) {
|
||||
return current_aircraft.fdm_state->get_engine(0)->get_EGT();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue