]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/NavDisplay.cxx
Make traffic take-off roll look a little better.
[flightgear.git] / src / Instrumentation / NavDisplay.cxx
index 5664828f952cfaaafeea6caaab6754eb7d55d91a..ecf9bdfc5532fbf67ee98b2258c9ec893681129a 100644 (file)
@@ -1088,8 +1088,8 @@ void NavDisplay::processNavRadios()
 
 FGNavRecord* NavDisplay::processNavRadio(const SGPropertyNode_ptr& radio)
 {
-    double mhz = radio->getDoubleValue("frequencies/selected-mhz", 0.0);
-    FGNavRecord* nav = globals->get_navlist()->findByFreq(mhz, _pos);
+  double mhz = radio->getDoubleValue("frequencies/selected-mhz", 0.0);
+  FGNavRecord* nav = FGNavList::findByFreq(mhz, _pos, FGNavList::navFilter());
     if (!nav || (nav->ident() != radio->getStringValue("nav-id"))) {
         // station was not found
         return NULL;
@@ -1114,21 +1114,6 @@ bool NavDisplay::anyRuleForType(const string& type) const
     return false;
 }
 
-bool NavDisplay::anyRuleMatches(const string& type, const string_set& states) const
-{
-    BOOST_FOREACH(SymbolRule* r, _rules) {
-        if (!r->enabled || (r->type != type)) {
-            continue;
-        }
-
-        if (r->matches(states)) {
-            return true;
-        }
-    } // of rules iteration
-    
-    return false;
-}
-
 void NavDisplay::findRules(const string& type, const string_set& states, SymbolRuleVector& rules)
 {
     BOOST_FOREACH(SymbolRule* candidate, _rules) {
@@ -1152,6 +1137,7 @@ bool NavDisplay::isPositionedShown(FGPositioned* pos)
 void NavDisplay::isPositionedShownInner(FGPositioned* pos, SymbolRuleVector& rules)
 {
   string type = FGPositioned::nameForType(pos->type());
+  boost::to_lower(type);
   if (!anyRuleForType(type)) {
     return; // not diplayed at all, we're done
   }
@@ -1186,7 +1172,7 @@ void NavDisplay::foundPositionedItem(FGPositioned* pos)
     
     BOOST_FOREACH(SymbolRule* r, rules) {
         SymbolInstance* ins = addSymbolInstance(projected, heading, r->getDefinition(), vars);
-        if (pos->type() == FGPositioned::RUNWAY) {
+        if ((ins)&&(pos->type() == FGPositioned::RUNWAY)) {
             FGRunway* rwy = (FGRunway*) pos;
             ins->endPos = projectGeod(rwy->end());
         }