#931: some VOR+ILS stations not working on 32bit machines
When casting to int, always remember the ugly effects of floating-point (im)precisions ;-).
This commit is contained in:
parent
91c6e3433d
commit
bf0dbb22d0
1 changed files with 3 additions and 3 deletions
|
@ -169,7 +169,7 @@ FGNavRecord *FGNavList::findByFreq( double freq, const SGGeod& position,
|
||||||
TypeFilter* filter)
|
TypeFilter* filter)
|
||||||
{
|
{
|
||||||
flightgear::NavDataCache* cache = flightgear::NavDataCache::instance();
|
flightgear::NavDataCache* cache = flightgear::NavDataCache::instance();
|
||||||
int freqKhz = static_cast<int>(freq * 100);
|
int freqKhz = static_cast<int>(freq * 100 + 0.5);
|
||||||
PositionedIDVec stations(cache->findNavaidsByFreq(freqKhz, position, filter));
|
PositionedIDVec stations(cache->findNavaidsByFreq(freqKhz, position, filter));
|
||||||
if (stations.empty()) {
|
if (stations.empty()) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -205,7 +205,7 @@ FGNavRecord *FGNavList::findByFreq( double freq, const SGGeod& position,
|
||||||
FGNavRecord *FGNavList::findByFreq( double freq, TypeFilter* filter)
|
FGNavRecord *FGNavList::findByFreq( double freq, TypeFilter* filter)
|
||||||
{
|
{
|
||||||
flightgear::NavDataCache* cache = flightgear::NavDataCache::instance();
|
flightgear::NavDataCache* cache = flightgear::NavDataCache::instance();
|
||||||
int freqKhz = static_cast<int>(freq * 100);
|
int freqKhz = static_cast<int>(freq * 100 + 0.5);
|
||||||
PositionedIDVec stations(cache->findNavaidsByFreq(freqKhz, filter));
|
PositionedIDVec stations(cache->findNavaidsByFreq(freqKhz, filter));
|
||||||
if (stations.empty()) {
|
if (stations.empty()) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -227,7 +227,7 @@ nav_list_type FGNavList::findAllByFreq( double freq, const SGGeod& position,
|
||||||
nav_list_type stations;
|
nav_list_type stations;
|
||||||
|
|
||||||
flightgear::NavDataCache* cache = flightgear::NavDataCache::instance();
|
flightgear::NavDataCache* cache = flightgear::NavDataCache::instance();
|
||||||
int freqKhz = static_cast<int>(freq * 1000);
|
int freqKhz = static_cast<int>(freq * 1000 + 0.5);
|
||||||
PositionedIDVec ids(cache->findNavaidsByFreq(freqKhz, position, filter));
|
PositionedIDVec ids(cache->findNavaidsByFreq(freqKhz, position, filter));
|
||||||
|
|
||||||
BOOST_FOREACH(PositionedID id, ids) {
|
BOOST_FOREACH(PositionedID id, ids) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue