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.
double FGTank::Reduce(double used)
{
- double shortage;
+ double shortage = Contents - used;
- if (used < Contents) {
+ if (shortage >= 0) {
Contents -= used;
PctFull = 100.0*Contents/Capacity;
- return 0.0;
} else {
- shortage = Contents - used;
Contents = 0.0;
PctFull = 0.0;
Selected = false;
- return shortage;
}
+ return shortage;
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%