From 341d210c995815bae80d91cd9985f79af0640a2a Mon Sep 17 00:00:00 2001 From: Rob Nelson Date: Thu, 23 Jan 2014 22:41:28 -0800 Subject: [PATCH] Fix some issues with the radio, like talking on common when calling for command. --- .../game/objects/items/devices/radio/radio.dm | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index 5187e9daf5d..432710a5bea 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -245,14 +245,21 @@ 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] - if (!channels[channel]) // if the channel is turned off, don't broadcast + testing("[src]: talk_into([M], [message], [channel])") + 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. return - else + else // If a channel isn't specified, send to common. connection = radio_connection channel = null if (!istype(connection))