From: adrian Date: Mon, 9 Jan 2012 17:47:25 +0000 (+0200) Subject: ITM radio calculations are only considered valid X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=045912f5a75cdad86388cbc1e022553d361575c3;p=flightgear.git ITM radio calculations are only considered valid between 40 MHz and 20 GHz. Fix for bug which assigns a frequency of 0 MHz to AI aircraft, thus resulting in infinite values. --- diff --git a/src/Radio/radio.cxx b/src/Radio/radio.cxx index 34f43cf69..169cd322f 100644 --- a/src/Radio/radio.cxx +++ b/src/Radio/radio.cxx @@ -211,7 +211,8 @@ void FGRadioTransmission::receiveATC(SGGeod tx_pos, double freq, string text, in double FGRadioTransmission::ITM_calculate_attenuation(SGGeod pos, double freq, int transmission_type) { - + if((freq < 40.0) || (freq > 20000.0)) // frequency out of recommended range + return -1; /** ITM default parameters TODO: take them from tile materials (especially for sea)? **/