From 695a9be75dcc57387ef7dcd4e8c3adcb7ab3afb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20de=20l=27Hamaide?= Date: Tue, 21 Jan 2014 00:06:43 +0100 Subject: [PATCH] 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" --- src/AIModel/AIBase.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) 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()); }