]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/navradio.cxx
Merge branch 'durk/traffic'
[flightgear.git] / src / Instrumentation / navradio.cxx
index 496e09518a16b9adfba1cde17cfa9dfd3c7b35af..0740090ddafb26ca2ccb5ef38c2a4d532ddc6940 100644 (file)
@@ -369,6 +369,8 @@ void FGNavRadio::clearOutputs()
   gs_deflection_deg_node->setDoubleValue(0.0);
   gs_deflection_norm_node->setDoubleValue(0.0);
   gs_inrange_node->setBoolValue( false );
+  loc_node->setBoolValue( false );
+  has_gs_node->setBoolValue(false);
   
   to_flag_node->setBoolValue( false );
   from_flag_node->setBoolValue( false );
@@ -898,7 +900,9 @@ void FGNavRadio::search()
     _gs = NULL;
     _dme = NULL;
     nav_id_node->setStringValue("");
-
+    loc_node->setBoolValue(false);
+    has_gs_node->setBoolValue(false);
+    
     _sgr->remove( nav_fx_name );
     _sgr->remove( dme_fx_name );
   }
@@ -913,7 +917,10 @@ void FGNavRadio::search()
 double FGNavRadio::localizerWidth(FGNavRecord* aLOC)
 {
   FGRunway* rwy = aLOC->runway();
-  assert(rwy);
+  if (!rwy) {
+    return 6.0; // no runway associated, return default value
+  }
+  
   
   SGVec3d thresholdCart(SGVec3d::fromGeod(rwy->threshold()));
   double axisLength = dist(aLOC->cart(), thresholdCart);