]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGTank.cpp
Updated to match changes in radiostack.[ch]xx
[flightgear.git] / src / FDM / JSBSim / FGTank.cpp
index 5ed9699091a64ee668fba2ca77b62621c2045763..9f77de5a1f82e4c8d6bc1ea3a3ba0f1c168c1ab9 100644 (file)
@@ -95,19 +95,17 @@ FGTank::~FGTank()
 
 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;
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -151,5 +149,11 @@ void FGTank::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }