]> git.mxchange.org Git - flightgear.git/commitdiff
Use --fg-aircraft paths for AI model
authorClément de l'Hamaide <clemaez@hotmail.fr>
Mon, 20 Jan 2014 23:06:43 +0000 (00:06 +0100)
committerClément de l'Hamaide <clemaez@hotmail.fr>
Mon, 20 Jan 2014 23:13:17 +0000 (00:13 +0100)
Firstly search model in $fg-root/AI/ path,
if not found, search model in --fg-aircraft paths,
if not found, search model in $fg-root/Aircraft path

This commit should solve the complaint "I have an aircraft in a separate Aircraft/ folder
but during MP session other user are shown with the aircraft from the $fg-root/Aircraft path
instead of this behaviour I want to see the aircraft from my separate Aircraft/ folder"

src/AIModel/AIBase.cxx

index b443d3b0826ed38b1e306e8c931f946bac3ee548..eede54b6a1a9df8782c42844aff07ec5b81e9a35 100644 (file)
@@ -358,6 +358,14 @@ bool FGAIBase::init(bool search_in_AI_path)
         BOOST_FOREACH(SGPath p, globals->get_data_paths("AI")) {
             paths.push_back(p.str());
         }
+
+        // search models in --fg-aircraft paths;
+        // when a copy of an aircraft is in --fg-aircraft paths
+        // we want to load this one instead of the default one from fgdata/Aircraft
+        BOOST_FOREACH(SGPath p, globals->get_aircraft_paths()) {
+            paths.push_back(p.str());
+        }
+
         f = osgDB::findDataFile(model_path, opt.get());
     }