From 1d8913b53ed2a4d72db463bc32ebffba38ae5f3d Mon Sep 17 00:00:00 2001 From: ThorstenB Date: Sun, 14 Nov 2010 21:06:19 +0100 Subject: [PATCH] Fixed path resolution (search --fg-aircraft dirs) Do not abort early when resource doesn't match /sim/aircraft-dir. --- src/Main/globals.cxx | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/Main/globals.cxx b/src/Main/globals.cxx index 29b791fe5..aa34a9660 100644 --- a/src/Main/globals.cxx +++ b/src/Main/globals.cxx @@ -56,7 +56,7 @@ #include "fg_props.hxx" #include "fg_io.hxx" - class AircraftResourceProvider : public simgear::ResourceProvider +class AircraftResourceProvider : public simgear::ResourceProvider { public: AircraftResourceProvider() : @@ -74,28 +74,27 @@ public: // test against the aircraft-dir property const char* aircraftDir = fgGetString("/sim/aircraft-dir"); string_list aircraftDirPieces(sgPathBranchSplit(aircraftDir)); - if (aircraftDirPieces.empty() || (aircraftDirPieces.back() != pieces[1])) { - return SGPath(); // current aircraft-dir does not match resource aircraft - } - - SGPath r(aircraftDir); - for (unsigned int i=2; iget_aircraft_paths()); string_list::const_iterator it = dirs.begin(); for (; it != dirs.end(); ++it) { SGPath p(*it, res); if (p.exists()) { - SG_LOG(SG_IO, SG_INFO, "found path:" << aResource << " in aircraft dir: " << r.str()); + SG_LOG(SG_IO, SG_INFO, "found path:" << aResource << " in aircraft dir: " << *it); return p; } } // of aircraft path iteration -- 2.39.5