]> git.mxchange.org Git - flightgear.git/commitdiff
BUGFIX: If/else bracket misplacement.
authordurk <durk>
Sat, 7 Feb 2009 09:25:28 +0000 (09:25 +0000)
committerTim Moore <timoore@redhat.com>
Mon, 9 Feb 2009 23:22:16 +0000 (00:22 +0100)
src/Airports/xmlloader.cxx

index 198f81c9e7b6fda4d00bdadf33bd0126202fc986..e808eaf5c01b5fe1871d899d04086c57b28ec65d 100644 (file)
@@ -48,6 +48,7 @@ void XMLLoader::load(FGAirportDynamics* d) {
        parkpath.append( "/AI/Airports/" );
        parkpath.append( d->getId() );
        parkpath.append( "parking.xml" );
+       SG_LOG(SG_GENERAL, SG_DEBUG, "running old loader:" << parkpath.c_str());
        if (parkpath.exists()) {
            try {
                readXML(parkpath.str(), visitor);
@@ -55,25 +56,27 @@ void XMLLoader::load(FGAirportDynamics* d) {
            } 
            catch (const sg_exception &e) {
            }
-       } else {
-            string_list sc = globals->get_fg_scenery();
-            char buffer[32];
-            snprintf(buffer, 32, "%s.groundnet.xml", d->getId().c_str() );
-            string airportDir = XMLLoader::expandICAODirs(d->getId());
-            for (string_list_iterator i = sc.begin(); i != sc.end(); i++) {
-                SGPath parkpath( *i );
-                parkpath.append( "Airports" );
-                parkpath.append ( airportDir );
-                parkpath.append( string (buffer) );
-                if (parkpath.exists()) {
-                    try {
-                        readXML(parkpath.str(), visitor);
-                        d->init();
-                    } 
-                    catch (const sg_exception &e) {
-                    }
-                    return;
+       }
+    } else {
+        string_list sc = globals->get_fg_scenery();
+        char buffer[32];
+        snprintf(buffer, 32, "%s.groundnet.xml", d->getId().c_str() );
+        string airportDir = XMLLoader::expandICAODirs(d->getId());
+        for (string_list_iterator i = sc.begin(); i != sc.end(); i++) {
+            SGPath parkpath( *i );
+            parkpath.append( "Airports" );
+            parkpath.append ( airportDir );
+            parkpath.append( string (buffer) );
+            SG_LOG(SG_GENERAL, SG_DEBUG, "Trying to read ground net:" << parkpath.c_str());
+            if (parkpath.exists()) {
+                SG_LOG(SG_GENERAL, SG_DEBUG, "reading ground net:" << parkpath.c_str());
+                try {
+                    readXML(parkpath.str(), visitor);
+                    d->init();
+                } 
+                catch (const sg_exception &e) {
                 }
+                return;
             }
         }
     }