mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-14 17:45:02 +01:00
Fixes bug with headsets unsetting channels after moving them (#64763)
Readds them to the global radio channels they belong to as opposed to setting what they belong to on equipped.
This commit is contained in:
@@ -110,9 +110,9 @@
|
||||
resetChannels()
|
||||
|
||||
if(keyslot)
|
||||
for(var/ch_name in keyslot.channels)
|
||||
if(!(ch_name in channels))
|
||||
channels[ch_name] = keyslot.channels[ch_name]
|
||||
for(var/channel_name in keyslot.channels)
|
||||
if(!(channel_name in channels))
|
||||
channels[channel_name] = keyslot.channels[channel_name]
|
||||
|
||||
if(keyslot.translate_binary)
|
||||
translate_binary = TRUE
|
||||
@@ -121,8 +121,8 @@
|
||||
if(keyslot.independent)
|
||||
independent = TRUE
|
||||
|
||||
for(var/ch_name in channels)
|
||||
secure_radio_connections[ch_name] = add_radio(src, GLOB.radiochannels[ch_name])
|
||||
for(var/channel_name in channels)
|
||||
secure_radio_connections[channel_name] = add_radio(src, GLOB.radiochannels[channel_name])
|
||||
|
||||
// Used for cyborg override
|
||||
/obj/item/radio/proc/resetChannels()
|
||||
@@ -132,6 +132,13 @@
|
||||
syndie = FALSE
|
||||
independent = FALSE
|
||||
|
||||
///goes through all radio channels we should be listening for and readds them to the global list
|
||||
/obj/item/radio/proc/readd_listening_radio_channels()
|
||||
for(var/channel_name in channels)
|
||||
add_radio(src, GLOB.radiochannels[channel_name])
|
||||
|
||||
add_radio(src, FREQ_COMMON)
|
||||
|
||||
/obj/item/radio/proc/make_syndie() // Turns normal radios into Syndicate radios!
|
||||
qdel(keyslot)
|
||||
keyslot = new /obj/item/encryptionkey/syndicate
|
||||
@@ -179,8 +186,7 @@
|
||||
should_be_listening = listening
|
||||
|
||||
if(listening && on)
|
||||
recalculateChannels()
|
||||
add_radio(src, frequency)
|
||||
readd_listening_radio_channels()
|
||||
else if(!listening)
|
||||
remove_radio_all(src)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user