From: adrian Date: Sun, 4 Sep 2011 11:20:41 +0000 (+0300) Subject: check for allowTransmission X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=9df5e8ee33a91a63f66dcd3847918af0649ebfc9;p=flightgear.git check for allowTransmission --- diff --git a/src/ATC/trafficcontrol.cxx b/src/ATC/trafficcontrol.cxx index 15520295a..f49026f48 100644 --- a/src/ATC/trafficcontrol.cxx +++ b/src/ATC/trafficcontrol.cxx @@ -734,7 +734,9 @@ void FGATCController::transmit(FGTrafficRecord * rec, FGAirportDynamics *parent, if ((onBoardRadioFreqI0 == stationFreq) || (onBoardRadioFreqI1 == stationFreq)) { - double snr = calculate_attenuation(rec, parent, ground_to_air); + + if (rec->allowTransmissions()) { + double snr = calculate_attenuation(rec, parent, ground_to_air); if (snr <= 0) return; if (snr > 0 && snr < 12) { @@ -749,8 +751,6 @@ void FGATCController::transmit(FGTrafficRecord * rec, FGAirportDynamics *parent, } } - - if (rec->allowTransmissions()) { fgSetString("/sim/messages/atc", text.c_str()); } }