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:
parent
2008529299
commit
47772b9853
1 changed files with 3 additions and 5 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
Loading…
Reference in a new issue