From: Clément de l'Hamaide Date: Mon, 20 Jan 2014 23:06:43 +0000 (+0100) Subject: Use --fg-aircraft paths for AI model X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=695a9be75dcc57387ef7dcd4e8c3adcb7ab3afb1;p=flightgear.git Use --fg-aircraft paths for AI model 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" --- diff --git a/src/AIModel/AIBase.cxx b/src/AIModel/AIBase.cxx index b443d3b08..eede54b6a 100644 --- a/src/AIModel/AIBase.cxx +++ b/src/AIModel/AIBase.cxx @@ -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()); }