]> git.mxchange.org Git - flightgear.git/commitdiff
Can't assume that the aircraft has a fuel tank.
authorandy <andy>
Thu, 1 Mar 2007 00:30:07 +0000 (00:30 +0000)
committerandy <andy>
Thu, 1 Mar 2007 00:30:07 +0000 (00:30 +0000)
src/FDM/YASim/FGFDM.cpp

index 0544898fed678eabc3377d805b5e479c0503ec1d..06a815f046f4b244b60ffff81a92be9bc1122aa7 100644 (file)
@@ -565,7 +565,10 @@ void FGFDM::setOutputProperties(float dt)
         }
     }
 
-    float fuelDensity = _airplane.getFuelDensity(0); // HACK
+    // Use the density of the first tank, or a dummy value if no tanks
+    float fuelDensity = 1.0;
+    if(_airplane.numTanks())
+        fuelDensity = _airplane.getFuelDensity(0);
     for(i=0; i<_thrusters.size(); i++) {
        EngRec* er = (EngRec*)_thrusters.get(i);
         Thruster* t = er->eng;