int range = sqlite3_column_int(loadCommStation, 0);
int freqKhz = sqlite3_column_int(loadCommStation, 1);
- CommStation* c = new CommStation(rowId, id, ty, pos, freqKhz, range);
+ CommStation* c = new CommStation(rowId, name, ty, pos, freqKhz, range);
c->setAirport(airport);
return c;
}
// reached this point with no exception, success
break;
} catch (sg_exception& e) {
- SG_LOG(SG_NAVCACHE, SG_WARN, "NavCache: init failed:" << e.what()
+ SG_LOG(SG_NAVCACHE, t == 0 ? SG_WARN : SG_ALERT, "NavCache: init failed:" << e.what()
<< " (attempt " << t << ")");
- homePath.remove();
d.reset();
+ homePath.remove();
}
} // of retry loop
sqlite3_bind_double(d->findCommByFreq, 5, cartPos.y());
sqlite3_bind_double(d->findCommByFreq, 6, cartPos.z());
- if (!d->execSelect(d->findCommByFreq)) {
- return NULL;
+ while (d->execSelect(d->findCommByFreq)) {
+ FGPositioned* p = loadById(sqlite3_column_int64(d->findCommByFreq, 0));
+ if (aFilter && !aFilter->pass(p)) {
+ continue;
+ }
+
+ return p;
}
- return loadById(sqlite3_column_int64(d->findCommByFreq, 0));
+ return NULL;
}
PositionedIDVec