1
0
Fork 0

navradio: fix crash spotted by Torsten, when nav range is unspecified.

This commit is contained in:
jmt 2009-09-14 22:41:29 +00:00 committed by Tim Moore
parent a650cf4239
commit c1598361ca

View file

@ -271,6 +271,10 @@ FGNavRadio::unbind ()
double FGNavRadio::adjustNavRange( double stationElev, double aircraftElev,
double nominalRange )
{
if (nominalRange < 0.0) {
nominalRange = FG_NAV_DEFAULT_RANGE;
}
// extend out actual usable range to be 1.3x the published safe range
const double usability_factor = 1.3;
@ -454,7 +458,7 @@ void FGNavRadio::updateReceiver(double dt)
effective_range
= adjustNavRange( nav_elev, pos.getElevationM(), _navaid->get_range() );
}
double effective_range_m = effective_range * SG_NM_TO_METER;
//////////////////////////////////////////////////////////