1
0
Fork 0

Removed code from ConsumeFuel() which failed due to rounding error.

This commit is contained in:
ehofman 2009-10-19 07:54:48 +00:00 committed by Tim Moore
parent 6fec83155e
commit 836aabae69

View file

@ -182,12 +182,13 @@ void FGEngine::ConsumeFuel(void)
Starved = false; Starved = false;
FuelToBurn = CalcFuelNeed(); FuelToBurn = CalcFuelNeed();
if (FuelToBurn == 0.0) return;
while (FuelToBurn > 0.0) { while (FuelToBurn > 0.0) {
// Count how many fuel tanks with the current priority level have fuel. // Count how many fuel tanks with the current priority level have fuel.
// If none, then try next lower priority. Build the feed list. // 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++) { for (i=0; i<Propulsion->GetNumTanks(); i++) {
if (SourceTanks[i] != 0) { if (SourceTanks[i] != 0) {
Tank = Propulsion->GetTank(i); Tank = Propulsion->GetTank(i);
@ -217,13 +218,6 @@ void FGEngine::ConsumeFuel(void)
Tank->Drain(FuelNeeded); Tank->Drain(FuelNeeded);
FuelToBurn -= 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 } // while
} }