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:
parent
527eb9d444
commit
9847bf3d13
2 changed files with 5 additions and 3 deletions
|
@ -1,7 +1,7 @@
|
||||||
#ifndef FG_NAVCACHE_SCHEMA_HXX
|
#ifndef FG_NAVCACHE_SCHEMA_HXX
|
||||||
#define FG_NAVCACHE_SCHEMA_HXX
|
#define FG_NAVCACHE_SCHEMA_HXX
|
||||||
|
|
||||||
const int SCHEMA_VERSION = 9;
|
const int SCHEMA_VERSION = 10;
|
||||||
|
|
||||||
#define SCHEMA_SQL \
|
#define SCHEMA_SQL \
|
||||||
"CREATE TABLE properties (key VARCHAR, value VARCHAR);" \
|
"CREATE TABLE properties (key VARCHAR, value VARCHAR);" \
|
||||||
|
|
|
@ -1916,7 +1916,7 @@ NavDataCache::findAirportRunway(const std::string& aName)
|
||||||
|
|
||||||
AirportRunwayPair result;
|
AirportRunwayPair result;
|
||||||
sqlite_bind_stdstring(d->findAirportRunway, 1, parts[0]);
|
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)) {
|
if (d->execSelect(d->findAirportRunway)) {
|
||||||
result = AirportRunwayPair(sqlite3_column_int64(d->findAirportRunway, 0),
|
result = AirportRunwayPair(sqlite3_column_int64(d->findAirportRunway, 0),
|
||||||
|
@ -1931,8 +1931,10 @@ NavDataCache::findAirportRunway(const std::string& aName)
|
||||||
}
|
}
|
||||||
|
|
||||||
PositionedID
|
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);
|
sqlite_bind_stdstring(d->findILS, 1, navIdent);
|
||||||
sqlite3_bind_int64(d->findILS, 2, airport);
|
sqlite3_bind_int64(d->findILS, 2, airport);
|
||||||
sqlite_bind_stdstring(d->findILS, 3, runway);
|
sqlite_bind_stdstring(d->findILS, 3, runway);
|
||||||
|
|
Loading…
Add table
Reference in a new issue