1
0
Fork 0

NavCache: fix an issue reloading ground-nets.

AndersG noticed an issue when a ground-net file is edited. The DROP commands prior to the reload were wrong, fixed now to delete all ground-net entries before the file is read.
This commit is contained in:
James Turner 2013-01-06 20:34:34 +00:00
parent 4873a28e97
commit ea81903f67

View file

@ -2115,9 +2115,10 @@ void NavDataCache::dropGroundnetFor(PositionedID aAirport)
sqlite3_bind_int64(q, 2, aAirport); sqlite3_bind_int64(q, 2, aAirport);
d->execUpdate(q); d->execUpdate(q);
q = d->prepare("DELETE FROM taxi_node WHERE rowid IN (SELECT rowid FROM positioned WHERE type=?1 AND airport=?2)"); q = d->prepare("DELETE FROM taxi_node WHERE rowid IN (SELECT rowid FROM positioned WHERE (type=?1 OR type=?2) AND airport=?3)");
sqlite3_bind_int(q, 1, FGPositioned::TAXI_NODE); sqlite3_bind_int(q, 1, FGPositioned::TAXI_NODE);
sqlite3_bind_int64(q, 2, aAirport); sqlite3_bind_int(q, 2, FGPositioned::PARKING);
sqlite3_bind_int64(q, 3, aAirport);
d->execUpdate(q); d->execUpdate(q);
q = d->prepare("DELETE FROM positioned WHERE (type=?1 OR type=?2) AND airport=?3"); q = d->prepare("DELETE FROM positioned WHERE (type=?1 OR type=?2) AND airport=?3");