]> git.mxchange.org Git - flightgear.git/commitdiff
Fixed a small bug in the engine lookup of bfi that is currently crashing
authorcurt <curt>
Mon, 9 Oct 2000 21:17:39 +0000 (21:17 +0000)
committercurt <curt>
Mon, 9 Oct 2000 21:17:39 +0000 (21:17 +0000)
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

index 3b4ec8c92704a49c00191f72ab2086f977346371..2b9945057d24ab4c08e41d7bada28e06c912e533 100644 (file)
@@ -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();
+  }
 }