]> git.mxchange.org Git - simgear.git/commitdiff
Fix detection of airports in the stg loader.
authorMathias Froehlich <Mathias.Froehlich@web.de>
Mon, 25 Feb 2013 18:36:54 +0000 (19:36 +0100)
committerMathias Froehlich <Mathias.Froehlich@web.de>
Sun, 16 Mar 2014 15:08:31 +0000 (16:08 +0100)
simgear/scene/tgdb/ReaderWriterSTG.cxx

index fd408406365829a0b83c4460e0bd3c2564992ff2..30e15fb0afd4d4906bcd9cf9dfe7a258b7f14760 100644 (file)
@@ -61,14 +61,14 @@ static bool isAirportBtg(const std::string& name)
 {
     if (name.size() < 8)
         return false;
-    if (name.substr(4, 8) != ".btg")
+    if (name.substr(4, 4) != ".btg")
         return false;
     for (unsigned i = 0; i < 4; ++i) {
-        if (name[i] < 'A' || 'Z' < name[i])
+        if ('A' <= name[i] && name[i] <= 'Z')
             continue;
-        return true;
+        return false;
     }
-    return false;
+    return true;
 }
 
 static SGBucket bucketIndexFromFileName(const std::string& fileName)