const string_list& paths(globals->get_aircraft_paths());
string_list::const_iterator it = paths.begin();
for (; it != paths.end(); ++it) {
- VisitResult vr = visitDir(simgear::Dir(*it), 0);
+ SGPath p(*it);
+ // additional aircraft-paths are supposed to specify the directory
+ // containing the 'Aircraft' dir (same structure as fg-root, so cross-
+ // aircraft resource paths can be resolved correctly). Some users omit
+ // this, so check for both.
+ p.append("Aircraft");
+ if (!p.exists())
+ p = SGPath(*it);
+
+ VisitResult vr = visitDir(p, 0);
if (vr != VISIT_CONTINUE) {
return vr;
}
{
SGPath dirPath(path);
if (!dirPath.exists()) {
- SG_LOG(SG_GENERAL, SG_WARN, "aircraft path not found:" << path);
+ SG_LOG(SG_GENERAL, SG_ALERT, "aircraft path not found:" << path);
return;
}
+
+ SGPath acSubdir(dirPath);
+ acSubdir.append("Aircraft");
+ if (!acSubdir.exists()) {
+ if (dirPath.file() == "Aircraft") {
+ dirPath = dirPath.dir();
+ SG_LOG(SG_GENERAL, SG_WARN, "Specified an aircraft-dir path ending in 'Aircraft':" << path
+ << ", will instead use parent directory:" << dirPath);
+ } else {
+ SG_LOG(SG_GENERAL, SG_ALERT, "Aircraft-dir path '" << path <<
+ "' does not contain an 'Aircraft' subdirectory, cross-aircraft paths will not resolve correctly.");
+ }
+ }
+
std::string abspath = dirPath.realpath();
unsigned int index = fg_aircraft_dirs.size();