]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGTank.cpp
builddir -> srcdir so builds can be done outside the master source directory.
[flightgear.git] / src / FDM / JSBSim / FGTank.cpp
index c08ff94e1ffed005dcd87d3ae1c157ad302e0a83..12fdf2ae004a0423e6f4269539c33bed410699dc 100644 (file)
@@ -58,7 +58,13 @@ FGTank::FGTank(FGConfigFile* AC_cfg)
   *AC_cfg >> Capacity;                          // pounds (amount it can hold)
   *AC_cfg >> Contents;                          // pounds  (amount it is holding)
   Selected = true;
-  PctFull = 100.0*Contents/Capacity;            // percent full; 0 to 100.0
+
+  if (Capacity != 0) {
+    PctFull = 100.0*Contents/Capacity;            // percent full; 0 to 100.0
+  } else {
+    Contents = 0;
+    PctFull  = 0;
+  }     
 }