]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/JSBSim.cxx
Fixed incomplete merge of JSBSim.cxx
[flightgear.git] / src / FDM / JSBSim / JSBSim.cxx
index 15b575123be9880825023b398b3a4e1a8bf68112..8b693bcab8221a2fd8f47f34524c29753e0dd243 100644 (file)
@@ -143,7 +143,7 @@ FGJSBsim::FGJSBsim( double dt )
             break;
         }
     }
-
+    
     fdmex = new FGFDMExec( (FGPropertyManager*)globals->get_props() );
 
     // Register ground callback.
@@ -290,6 +290,8 @@ FGJSBsim::FGJSBsim( double dt )
         fgGetDouble("/fdm/jsbsim/systems/hook/tailhook-offset-x-in", 196),
         fgGetDouble("/fdm/jsbsim/systems/hook/tailhook-offset-y-in", 0),
         fgGetDouble("/fdm/jsbsim/systems/hook/tailhook-offset-z-in", -16));
+    last_hook_tip[0] = 0; last_hook_tip[1] = 0; last_hook_tip[2] = 0;
+    last_hook_root[0] = 0; last_hook_root[1] = 0; last_hook_root[2] = 0;
 
     crashed = false;
 }
@@ -298,13 +300,6 @@ FGJSBsim::FGJSBsim( double dt )
 FGJSBsim::~FGJSBsim(void)
 {
   delete fdmex;
-  
-  SGPropertyNode_ptr jsbsimRoot = fgGetNode("/fdm/jsbsim");
-  if (jsbsimRoot) {
-    SGPropertyNode* fdm = jsbsimRoot->getParent();
-    fdm->removeChild("jsbsim", 0, false);
-  }
-  // properties are deleted when the sharedPtr above goes away
 }
 
 /******************************************************************************/
@@ -427,6 +422,14 @@ void FGJSBsim::init()
 
 /******************************************************************************/
 
+void FGJSBsim::unbind()
+{
+  fdmex->Unbind();
+  FGInterface::unbind();
+}
+
+/******************************************************************************/
+
 // Run an iteration of the EOM (equations of motion)
 
 void FGJSBsim::update( double dt )