From: ehofman Date: Sun, 8 Jun 2003 08:45:07 +0000 (+0000) Subject: Fix a problem where the contents could be specified by JSBSim and by FlightGear,... X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=1100ae47e4e217c61625f3be775a9e3ac3c1d8ed;p=flightgear.git Fix a problem where the contents could be specified by JSBSim and by FlightGear, where JSBSim would override the FlightGear specified value. Now the JSBSim specified value will be discarded if Contents is already set. --- diff --git a/src/FDM/JSBSim/FGTank.cpp b/src/FDM/JSBSim/FGTank.cpp index 664b6b4ce..dd4407317 100644 --- a/src/FDM/JSBSim/FGTank.cpp +++ b/src/FDM/JSBSim/FGTank.cpp @@ -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;