diff --git a/src/Navaids/ilslist.cxx b/src/Navaids/ilslist.cxx index eb9247f0a..e7bd0994e 100644 --- a/src/Navaids/ilslist.cxx +++ b/src/Navaids/ilslist.cxx @@ -80,8 +80,13 @@ bool FGILSList::init( SGPath path ) { double min = 1000000.0; double max = 0.0; - while ( ! in.eof() && ils.get_ilstype() != '[' ) { + while ( ! in.eof() ) { in >> ils; + + if ( ils.get_ilstype() == '[' ) { + break; + } + /* cout << "id = " << n.get_ident() << endl; cout << " type = " << n.get_type() << endl; cout << " lon = " << n.get_lon() << endl; @@ -89,9 +94,8 @@ bool FGILSList::init( SGPath path ) { cout << " elev = " << n.get_elev() << endl; cout << " freq = " << n.get_freq() << endl; cout << " range = " << n.get_range() << endl; */ - if ( ils.get_ilstype() != '[' ) { - ilslist[ils.get_locfreq()].push_back(ils); - } + + ilslist[ils.get_locfreq()].push_back(ils); in >> skipcomment; if ( ils.get_locfreq() < min ) { diff --git a/src/Navaids/navlist.cxx b/src/Navaids/navlist.cxx index 0bfd42a69..3892dcb8d 100644 --- a/src/Navaids/navlist.cxx +++ b/src/Navaids/navlist.cxx @@ -79,8 +79,13 @@ bool FGNavList::init( SGPath path ) { double min = 100000; double max = 0; - while ( ! in.eof() && n.get_type() != '[' ) { + while ( ! in.eof() ) { in >> n; + + if ( n.get_type() == '[' ) { + break; + } + /* cout << "id = " << n.get_ident() << endl; cout << " type = " << n.get_type() << endl; cout << " lon = " << n.get_lon() << endl; @@ -88,9 +93,8 @@ bool FGNavList::init( SGPath path ) { cout << " elev = " << n.get_elev() << endl; cout << " freq = " << n.get_freq() << endl; cout << " range = " << n.get_range() << endl; */ - if ( n.get_type() != '[' ) { - navaids[n.get_freq()].push_back(n); - } + + navaids[n.get_freq()].push_back(n); in >> skipcomment; if ( n.get_type() != 'N' ) {