From 1100ae47e4e217c61625f3be775a9e3ac3c1d8ed Mon Sep 17 00:00:00 2001 From: ehofman Date: Sun, 8 Jun 2003 08:45:07 +0000 Subject: [PATCH] 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. --- src/FDM/JSBSim/FGTank.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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; -- 2.39.5