- FGRunwayPreferenceXMLLoader visitor(p);
- if (fgGetBool("/sim/traffic-manager/use-custom-scenery-data") == false) {
- SGPath rwyPrefPath( globals->get_fg_root() );
- rwyPrefPath.append( "AI/Airports/" );
- rwyPrefPath.append( p->getId() );
- rwyPrefPath.append( "rwyuse.xml" );
- if (rwyPrefPath.exists()) {
- try {
- readXML(rwyPrefPath.str(), visitor);
- }
- catch (const sg_exception &e) {
- }
- }
- } else {
- string_list sc = globals->get_fg_scenery();
- char buffer[32];
- snprintf(buffer, 32, "%s.rwyuse.xml", p->getId().c_str() );
- string airportDir = expandICAODirs(p->getId());
- for (string_list_iterator i = sc.begin(); i != sc.end(); i++) {
- SGPath rwypath( *i );
- rwypath.append( "Airports" );
- rwypath.append ( airportDir );
- rwypath.append( string(buffer) );
- if (rwypath.exists()) {
- try {
- readXML(rwypath.str(), visitor);
- }
- catch (const sg_exception &e) {
- }
- return;
- }
+ FGRunwayPreferenceXMLLoader visitor(p);
+ if (fgGetBool("/sim/paths/use-custom-scenery-data") == false) {
+ SGPath rwyPrefPath( globals->get_fg_root() );
+ rwyPrefPath.append( "AI/Airports/" );
+ rwyPrefPath.append( p->getId() );
+ rwyPrefPath.append( "rwyuse.xml" );
+ if (rwyPrefPath.exists()) {
+ try {
+ readXML(rwyPrefPath.str(), visitor);
+ }
+ catch (const sg_exception &) {