]> git.mxchange.org Git - flightgear.git/commitdiff
ITM radio calculations are only considered valid
authoradrian <adrian@localhost.com>
Mon, 9 Jan 2012 17:47:25 +0000 (19:47 +0200)
committerThorstenB <brehmt@gmail.com>
Mon, 9 Jan 2012 20:01:01 +0000 (21:01 +0100)
between 40 MHz and 20 GHz.
Fix for bug which assigns a frequency of 0 MHz to
AI aircraft, thus resulting in infinite values.

src/Radio/radio.cxx

index 34f43cf69fb05950de769a85ed885ac5cbefd9f5..169cd322f19bb650c25806fde84f76d8fde3d46b 100644 (file)
@@ -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)?
        **/