1
0
Fork 0

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
This commit is contained in:
James Turner 2014-03-23 09:53:00 +00:00
parent 527eb9d444
commit 9847bf3d13
2 changed files with 5 additions and 3 deletions

View 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);" \

View 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);