]> git.mxchange.org Git - flightgear.git/commitdiff
Restored JSBSim to a working state in FlightGear.
authorAnders Gidenstam <anders@gidenstam.org>
Mon, 23 Sep 2013 20:27:51 +0000 (22:27 +0200)
committerAnders Gidenstam <anders@gidenstam.org>
Mon, 23 Sep 2013 20:33:23 +0000 (22:33 +0200)
src/FDM/JSBSim/math/FGFunction.cpp
src/FDM/JSBSim/models/FGPropagate.cpp

index 328ca06b81b902d22642243ede409ecf3ee1f765..0de0ecf431fb7b8e6fd9599f299cd7dd3c0d0aaa 100644 (file)
@@ -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);
   }
 }
 
index 83c3e7f22b0269269b13f49bff046c3211a9b521..d1183a43b37c373e289ca267d59deeb7c3a3ff0f 100644 (file)
@@ -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;