]> git.mxchange.org Git - flightgear.git/blobdiff - src/Instrumentation/navradio.cxx
Merge branch 'jmt/gps' into next
[flightgear.git] / src / Instrumentation / navradio.cxx
index 4bfe15d48f9fc9071740c3471934c3d671d52dfc..cf748e43f2c0facab9c487f365c59afbed3e09d1 100644 (file)
@@ -376,6 +376,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 );
@@ -925,7 +927,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 );
   }
@@ -940,7 +944,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);