]> git.mxchange.org Git - flightgear.git/commitdiff
Fix for bug 1419, nav.dat runway binding
authorJames Turner <zakalawe@mac.com>
Sun, 23 Mar 2014 09:53:00 +0000 (09:53 +0000)
committerJames Turner <zakalawe@mac.com>
Sun, 23 Mar 2014 09:53:00 +0000 (09:53 +0000)
Clean runway names to standard structure (0-prefix) before looking up
in the cache, when binding ILS navs to runways.

https://code.google.com/p/flightgear-bugs/issues/detail?id=1419

src/Navaids/CacheSchema.h
src/Navaids/NavDataCache.cxx

index e977ab6dfd89644ac7be21d3b259254f220ca256..297ab3e11161c2d659e633416a9ab9e4a68a5553 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef FG_NAVCACHE_SCHEMA_HXX
 #define FG_NAVCACHE_SCHEMA_HXX
 
-const int SCHEMA_VERSION = 9;
+const int SCHEMA_VERSION = 10;
 
 #define SCHEMA_SQL \
 "CREATE TABLE properties (key VARCHAR, value VARCHAR);" \
index 88a43220069da5f9450aa5e0cdc7360e5bc5562e..f34294e11abc5f20b25da76afabf6604696bffee 100644 (file)
@@ -1916,7 +1916,7 @@ NavDataCache::findAirportRunway(const std::string& aName)
 
   AirportRunwayPair result;
   sqlite_bind_stdstring(d->findAirportRunway, 1, parts[0]);
-  sqlite_bind_stdstring(d->findAirportRunway, 2, parts[1]);
+  sqlite_bind_stdstring(d->findAirportRunway, 2, cleanRunwayNo(parts[1]));
   
   if (d->execSelect(d->findAirportRunway)) {
     result = AirportRunwayPair(sqlite3_column_int64(d->findAirportRunway, 0),
@@ -1931,8 +1931,10 @@ NavDataCache::findAirportRunway(const std::string& aName)
 }
   
 PositionedID
-NavDataCache::findILS(PositionedID airport, const string& runway, const string& navIdent)
+NavDataCache::findILS(PositionedID airport, const string& aRunway, const string& navIdent)
 {
+  string runway(cleanRunwayNo(aRunway));
+    
   sqlite_bind_stdstring(d->findILS, 1, navIdent);
   sqlite3_bind_int64(d->findILS, 2, airport);
   sqlite_bind_stdstring(d->findILS, 3, runway);