]> git.mxchange.org Git - flightgear.git/blobdiff - src/Radio/radio.cxx
commradio: improvements for atis speech
[flightgear.git] / src / Radio / radio.cxx
index 34f43cf69fb05950de769a85ed885ac5cbefd9f5..62f233edf6e542e4b975a28ec84e314fb25121f0 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)?
        **/
@@ -322,10 +323,12 @@ double FGRadioTransmission::ITM_calculate_attenuation(SGGeod pos, double freq, i
        while (elevations.size() <= e_size) {
                probe_distance += point_distance;
                SGGeod probe = SGGeod::fromGeoc(center.advanceRadM( course, probe_distance ));
-               const SGMaterial *mat = 0;
+               const simgear::BVHMaterial *material = 0;
                double elevation_m = 0.0;
        
-               if (scenery->get_elevation_m( probe, elevation_m, &mat )) {
+               if (scenery->get_elevation_m( probe, elevation_m, &material )) {
+                        const SGMaterial *mat;
+                        mat = dynamic_cast<const SGMaterial*>(material);
                        if((transmission_type == 3) || (transmission_type == 4)) {
                                elevations.push_back(elevation_m);
                                if(mat) {