From 3d7b7a937c96e0a9185fcb5435edacb86b9e1ed8 Mon Sep 17 00:00:00 2001 From: yashaldie Date: Fri, 28 Feb 2014 05:42:42 -0500 Subject: [PATCH] Missed some codes... Forgot to add some code from a past bug fix i did on my end. --- .../game/objects/items/devices/radio/radio.dm | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index 97ac8dc0fd5..bd3eeb495d4 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -244,12 +244,19 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use //#### Grab the connection datum ####// var/datum/radio_frequency/connection = null - if(channel && channels && channels.len > 0) - if (channel == "department") - //world << "DEBUG: channel=\"[channel]\" switching to \"[channels[1]]\"" - channel = channels[1] - connection = secure_radio_connections[channel] - else + if(channel == "headset") + channel = null + if(channel) // If a channel is specified, look for it. + if(channels && channels.len > 0) + if (channel == "department") + //world << "DEBUG: channel=\"[channel]\" switching to \"[channels[1]]\"" + channel = channels[1] + connection = secure_radio_connections[channel] + if (!channels[channel]) // if the channel is turned off, don't broadcast + return + else + // If we were to send to a channel we don't have, drop it. + else // If a channel isn't specified, send to common. connection = radio_connection channel = null if (!istype(connection))