Empty "markers" in between scenery search paths shouldn't be
considered when building search paths.
aICAO.c_str(), fileName.c_str());
for (string_list_iterator it = sc.begin(); it != sc.end(); ++it) {
- SGPath path(*it);
- path.append("Airports");
- path.append(string(buffer));
- if (path.exists()) {
- aPath = path;
- return true;
- } // of path exists
+ // fg_senery contains empty strings as "markers" (see FGGlobals::set_fg_scenery)
+ if (!it->empty()) {
+ SGPath path(*it);
+ path.append("Airports");
+ path.append(string(buffer));
+ if (path.exists()) {
+ aPath = path;
+ return true;
+ } // of path exists
+ }
} // of scenery path iteration
return false;
}
string_list sc = globals->get_fg_scenery();
for (string_list_iterator it = sc.begin(); it != sc.end(); ++it) {
- SGPath tmpPath(*it);
- tmpPath.append(modelPath);
- if (tmpPath.exists()) {
- fullPath = tmpPath;
- break;
- }
+ // fg_senery contains empty strings as "markers" (see FGGlobals::set_fg_scenery)
+ if (!it->empty()) {
+ SGPath tmpPath(*it);
+ tmpPath.append(modelPath);
+ if (tmpPath.exists()) {
+ fullPath = tmpPath;
+ break;
+ }
+ }
}
} else {
fullPath.append(modelPath);