From c0424aba7e483f2011b61f02307b659b71e2f56e Mon Sep 17 00:00:00 2001 From: James Turner Date: Thu, 29 Aug 2013 22:13:43 +0100 Subject: [PATCH] SG part of fix for TerraSync models. Ensure we search the TerraSync models tree before the FG_ROOT one, since the TerraSync one contains newer files and updates to the base one. --- simgear/scene/tgdb/ReaderWriterSTG.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/simgear/scene/tgdb/ReaderWriterSTG.cxx b/simgear/scene/tgdb/ReaderWriterSTG.cxx index 44512068..74224d4d 100644 --- a/simgear/scene/tgdb/ReaderWriterSTG.cxx +++ b/simgear/scene/tgdb/ReaderWriterSTG.cxx @@ -185,6 +185,14 @@ struct ReaderWriterSTG::_ModelBin { SGPath path = filePath; path.append(".."); path.append(".."); path.append(".."); sharedOptions->getDatabasePathList().push_back(path.str()); + + // ensure Models directory synced via TerraSync is searched before the copy in + // FG_ROOT, so that updated models can be used. + std::string terrasync_root = options->getPluginStringData("SimGear::TERRASYNC_ROOT"); + if (!terrasync_root.empty()) { + sharedOptions->getDatabasePathList().push_back(terrasync_root); + } + std::string fg_root = options->getPluginStringData("SimGear::FG_ROOT"); sharedOptions->getDatabasePathList().push_back(fg_root); -- 2.39.5