Fix headset channel resetting (#15470)

This commit is contained in:
Wildkins
2022-12-29 18:50:37 -05:00
committed by GitHub
parent 68ed61dc56
commit 329b4df2e8
3 changed files with 15 additions and 5 deletions
@@ -141,6 +141,7 @@
/obj/item/device/radio/headset/proc/recalculateChannels(var/setDescription = FALSE)
var/list/old_channel_settings = channels.Copy()
channels = list()
translate_binary = FALSE
translate_hivenet = FALSE
@@ -176,6 +177,8 @@
independent = TRUE
for (var/ch_name in channels)
if(ch_name in old_channel_settings)
channels[ch_name] = old_channel_settings[ch_name]
secure_radio_connections[ch_name] = SSradio.add_object(src, radiochannels[ch_name], RADIO_CHAT)
if(setDescription)
@@ -487,13 +487,13 @@ var/global/list/default_medbay_channels = list(
if ((input_frequency in ANTAG_FREQS) && !syndie) //Checks to see if it's allowed on that frequency, based on the encryption keys
return FALSE
if (input_frequency == frequency)
return TRUE
for (var/ch_name in channels)
var/datum/radio_frequency/RF = secure_radio_connections[ch_name]
if (RF.frequency == input_frequency && (channels[ch_name] & FREQ_LISTENING))
return TRUE
if (RF.frequency == input_frequency)
return channels[ch_name]
if (input_frequency == frequency)
return TRUE
return FALSE