]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGInitialCondition.cpp
JSBSim updates. This update changes the file format, so an update of the base
[flightgear.git] / src / FDM / JSBSim / FGInitialCondition.cpp
index 58d739053263ae76f4e15bcda297c4ee8d1345b7..f9fbc31b5c7236005480376e85f17e77b2ca261e 100644 (file)
@@ -46,6 +46,7 @@ INCLUDES
 #include "FGFDMExec.h"
 #include "FGState.h"
 #include "FGAtmosphere.h"
+#include "FGAerodynamics.h"
 #include "FGFCS.h"
 #include "FGAircraft.h"
 #include "FGTranslation.h"
@@ -717,19 +718,25 @@ double FGInitialCondition::GetWindDirDegIC(void) {
 
 //******************************************************************************
 
-bool FGInitialCondition::Load(string acpath, string acname, string rstfile)
+bool FGInitialCondition::Load(string rstfile, bool useStoredPath)
 {
   string resetDef;
   string token="";
 
   double temp;
-
-# ifndef macintosh
-  resetDef = acpath + "/" + acname + "/" + rstfile + ".xml";
-# else
-  resetDef = acpath + ";" + acname + ";" + rstfile + ".xml";
-# endif
-
+  # ifndef macintosh
+    string sep = "/";
+  # else
+    string sep = ";";
+  #endif     
+  
+  if( useStoredPath ) {
+    string acpath = fdmex->GetAircraftPath() + sep + fdmex->GetModelName();
+    resetDef = acpath + sep + rstfile + ".xml";
+  } else {
+    resetDef = rstfile;
+  }  
+  
   FGConfigFile resetfile(resetDef);
   if (!resetfile.IsOpen()) {
     cerr << "Failed to open reset file: " << resetDef << endl;
@@ -770,7 +777,7 @@ bool FGInitialCondition::Load(string acpath, string acname, string rstfile)
     resetfile >> token;
   }
 
-  fdmex->RunIC(this);
+  fdmex->RunIC();
   
   return true;
 }