1
0
Fork 0

Return a positive shortage when there is still fuel in the tank;

otherwise, the logic in FGEngine::ConsumeFuel breaks down and the
engine is starved when *any* feed tank is empty, rather than when all
feed tanks are empty.
This commit is contained in:
david 2002-01-19 18:25:52 +00:00
parent 2008529299
commit 47772b9853

View file

@ -95,19 +95,17 @@ FGTank::~FGTank()
double FGTank::Reduce(double used) double FGTank::Reduce(double used)
{ {
double shortage; double shortage = Contents - used;
if (used < Contents) { if (shortage >= 0) {
Contents -= used; Contents -= used;
PctFull = 100.0*Contents/Capacity; PctFull = 100.0*Contents/Capacity;
return 0.0;
} else { } else {
shortage = Contents - used;
Contents = 0.0; Contents = 0.0;
PctFull = 0.0; PctFull = 0.0;
Selected = false; Selected = false;
return shortage;
} }
return shortage;
} }
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%