mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Radio and TACAN frequencies are now clamped
This commit is contained in:
@@ -538,6 +538,12 @@ void Unit::setTACAN(DataTypes::TACAN newTACAN, bool force)
|
||||
TACAN = newTACAN;
|
||||
if (TACAN.isOn) {
|
||||
std::ostringstream commandSS;
|
||||
|
||||
if (TACAN.channel < 0)
|
||||
TACAN.channel = 0;
|
||||
if (TACAN.channel > 126)
|
||||
TACAN.channel = 126;
|
||||
|
||||
commandSS << "{"
|
||||
<< "id = 'ActivateBeacon',"
|
||||
<< "params = {"
|
||||
@@ -575,6 +581,12 @@ void Unit::setRadio(DataTypes::Radio newRadio, bool force)
|
||||
std::ostringstream commandSS;
|
||||
Command* command;
|
||||
|
||||
if (radio.frequency < 0)
|
||||
radio.frequency = 0;
|
||||
|
||||
if (radio.frequency > 999000000)
|
||||
radio.frequency = 999000000;
|
||||
|
||||
commandSS << "{"
|
||||
<< "id = 'SetFrequency',"
|
||||
<< "params = {"
|
||||
|
||||
Reference in New Issue
Block a user