]> git.mxchange.org Git - flightgear.git/commitdiff
NavCache: fix an issue reloading ground-nets.
authorJames Turner <zakalawe@mac.com>
Sun, 6 Jan 2013 20:34:34 +0000 (20:34 +0000)
committerJames Turner <zakalawe@mac.com>
Sun, 6 Jan 2013 20:34:34 +0000 (20:34 +0000)
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.

src/Navaids/NavDataCache.cxx

index 6b102f2fbde6e0389699f1349f39bc62da214aa9..a79778c70e14ebbdc4fbcd71da79832e54d8c522 100644 (file)
@@ -2115,9 +2115,10 @@ void NavDataCache::dropGroundnetFor(PositionedID aAirport)
   sqlite3_bind_int64(q, 2, aAirport);
   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_int64(q, 2, aAirport);
+  sqlite3_bind_int(q, 2, FGPositioned::PARKING);
+  sqlite3_bind_int64(q, 3, aAirport);
   d->execUpdate(q);
   
   q = d->prepare("DELETE FROM positioned WHERE (type=?1 OR type=?2) AND airport=?3");