From: Anders Gidenstam Date: Mon, 23 Sep 2013 20:27:51 +0000 (+0200) Subject: Restored JSBSim to a working state in FlightGear. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5a4b9c617cd30c1d11ffbbbe0eef19d4f5b13868;p=flightgear.git Restored JSBSim to a working state in FlightGear. --- diff --git a/src/FDM/JSBSim/math/FGFunction.cpp b/src/FDM/JSBSim/math/FGFunction.cpp index 328ca06b8..0de0ecf43 100644 --- a/src/FDM/JSBSim/math/FGFunction.cpp +++ b/src/FDM/JSBSim/math/FGFunction.cpp @@ -807,11 +807,12 @@ void FGFunction::bind(void) } if (PropertyManager->HasNode(tmp)) { + FGPropertyNode* property = PropertyManager->GetNode(tmp); + if (property->isTied()) { cout << "Property " << tmp << " has already been successfully bound (late)." << endl; - } else { - PropertyManager->Tie( tmp, this, &FGFunction::GetValue); } - + } + PropertyManager->Tie( tmp, this, &FGFunction::GetValue); } } diff --git a/src/FDM/JSBSim/models/FGPropagate.cpp b/src/FDM/JSBSim/models/FGPropagate.cpp index 83c3e7f22..d1183a43b 100644 --- a/src/FDM/JSBSim/models/FGPropagate.cpp +++ b/src/FDM/JSBSim/models/FGPropagate.cpp @@ -676,7 +676,8 @@ void FGPropagate::WriteStateFile(int num) outfile.close(); break; default: - throw("When writing a state file, the supplied value must be 1 or 2 for the version number of teh resulting IC file"); + return; // Ignore other writes to the property, e.g. on FlightGear reset. + throw("When writing a state file, the supplied value must be 1 or 2 for the version number of the resulting IC file"); } } else { cerr << "Could not open and/or write the state to the initial conditions file: " << filename << endl;