From: ehofman Date: Mon, 19 Oct 2009 07:54:48 +0000 (+0000) Subject: Removed code from ConsumeFuel() which failed due to rounding error. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=836aabae6950bcd2df5cd14c7773c432f6b597d3;p=flightgear.git Removed code from ConsumeFuel() which failed due to rounding error. --- diff --git a/src/FDM/JSBSim/models/propulsion/FGEngine.cpp b/src/FDM/JSBSim/models/propulsion/FGEngine.cpp index fd7290029..99c8df174 100644 --- a/src/FDM/JSBSim/models/propulsion/FGEngine.cpp +++ b/src/FDM/JSBSim/models/propulsion/FGEngine.cpp @@ -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; iGetNumTanks(); 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 }