]> git.mxchange.org Git - flightgear.git/commitdiff
Removed code from ConsumeFuel() which failed due to rounding error.
authorehofman <ehofman>
Mon, 19 Oct 2009 07:54:48 +0000 (07:54 +0000)
committerTim Moore <timoore@redhat.com>
Mon, 19 Oct 2009 21:58:14 +0000 (23:58 +0200)
src/FDM/JSBSim/models/propulsion/FGEngine.cpp

index fd7290029c2eac9ca5cead79a6a542bd9dcc7301..99c8df174c4dcf47a80e15420eb04573cf0c1287 100644 (file)
@@ -182,12 +182,13 @@ void FGEngine::ConsumeFuel(void)
   Starved = false;
 
   FuelToBurn = CalcFuelNeed();
+  if (FuelToBurn == 0.0) return;
 
   while (FuelToBurn > 0.0) {
 
     // Count how many fuel tanks with the current priority level have fuel.
     // If none, then try next lower priority.  Build the feed list.
-    while ((TanksWithFuel == 0.0) && (CurrentPriority <= Propulsion->GetNumTanks())) {
+    while ((TanksWithFuel == 0) && (CurrentPriority <= Propulsion->GetNumTanks())) {
       for (i=0; i<Propulsion->GetNumTanks(); i++) {
         if (SourceTanks[i] != 0) {
           Tank = Propulsion->GetTank(i);
@@ -217,13 +218,6 @@ void FGEngine::ConsumeFuel(void)
       Tank->Drain(FuelNeeded); 
       FuelToBurn -= FuelNeeded;
     }
-
-    // check if we were not able to burn all the fuel we needed to at this priority level
-    if (FuelToBurn > 0.0) {
-      CurrentPriority++;
-      TanksWithFuel = 0;
-      FeedList.clear();
-    }
  
   }  // while
 }