From 9847bf3d13cf97c8f7b061fbc003ff3e4c9071d6 Mon Sep 17 00:00:00 2001 From: James Turner Date: Sun, 23 Mar 2014 09:53:00 +0000 Subject: [PATCH] Fix for bug 1419, nav.dat runway binding 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 | 2 +- src/Navaids/NavDataCache.cxx | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Navaids/CacheSchema.h b/src/Navaids/CacheSchema.h index e977ab6df..297ab3e11 100644 --- a/src/Navaids/CacheSchema.h +++ b/src/Navaids/CacheSchema.h @@ -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);" \ diff --git a/src/Navaids/NavDataCache.cxx b/src/Navaids/NavDataCache.cxx index 88a432200..f34294e11 100644 --- a/src/Navaids/NavDataCache.cxx +++ b/src/Navaids/NavDataCache.cxx @@ -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); -- 2.39.5