navradio: fix crash spotted by Torsten, when nav range is unspecified.
This commit is contained in:
parent
a650cf4239
commit
c1598361ca
1 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
|
||||
//////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Reference in a new issue