]> git.mxchange.org Git - flightgear.git/commitdiff
Fix a problem where the contents could be specified by JSBSim and by FlightGear,...
authorehofman <ehofman>
Sun, 8 Jun 2003 08:45:07 +0000 (08:45 +0000)
committerehofman <ehofman>
Sun, 8 Jun 2003 08:45:07 +0000 (08:45 +0000)
src/FDM/JSBSim/FGTank.cpp

index 664b6b4ce006108c85c02b4329f65b0de2e10351..dd4407317373de22aeb90b86acd3508e2f7d2916 100644 (file)
@@ -54,6 +54,7 @@ CLASS IMPLEMENTATION
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 FGTank::FGTank(FGConfigFile* AC_cfg)
+    : Contents(0.0)
 {
   string token;
   
@@ -70,8 +71,9 @@ FGTank::FGTank(FGConfigFile* AC_cfg)
     else if (token == "ZLOC") *AC_cfg >> Z;
     else if (token == "RADIUS") *AC_cfg >> Radius;
     else if (token == "CAPACITY") *AC_cfg >> Capacity;
-    else if (token == "CONTENTS") *AC_cfg >> Contents;
-    else cerr << "Unknown identifier: " << token << " in tank definition." << endl;
+    else if (token == "CONTENTS") {
+        if (Contents == 0.0) *AC_cfg >> Contents;
+    } else cerr << "Unknown identifier: " << token << " in tank definition." << endl;
   }
   
   Selected = true;