]> git.mxchange.org Git - flightgear.git/commitdiff
Allow -jsbsim, -yasim or -uiuc in the name of the configuration file when it resides...
authorehofman <ehofman>
Mon, 15 Sep 2003 16:00:18 +0000 (16:00 +0000)
committerehofman <ehofman>
Mon, 15 Sep 2003 16:00:18 +0000 (16:00 +0000)
src/Main/fg_init.cxx

index e5da97091158a404f5887c51175b1c3b00669d4a..38370e9f575493ba724cd243c78bd9504b12d74c 100644 (file)
@@ -534,9 +534,19 @@ bool fgInitConfig ( int argc, char **argv ) {
         aircraft_path.concat("-set.xml");
 
         if ( !ulFileExists(aircraft_path.c_str()) ) {
+            string adir = aircraft;
+            int pos, alen = adir.length();
+
+            if ( ((pos = adir.rfind("-jsbsim")) != string::npos) ||
+                 ((pos = adir.rfind("-yasim")) != string::npos) ||
+                 ((pos = adir.rfind("-uiuc")) != string::npos) )
+            {
+                adir.erase(pos, alen);
+            }
+
             aircraft_path = globals->get_fg_root();
             aircraft_path.append("Aircraft");
-            aircraft_path.append(aircraft);
+            aircraft_path.append(adir);
             aircraft_path.append(aircraft);
             aircraft_path.concat("-set.xml");
         }