diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index 45420280f6..bd3eeb495d 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)) @@ -744,7 +751,9 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use if(keyslot.syndie) src.syndie = 1 - + var/mob/living/silicon/robot/Ro = usr + if(Ro.module) + src.config(Ro.module.channels) for (var/ch_name in channels) if(!radio_controller) @@ -761,12 +770,16 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use if(usr.stat || !on) return if (href_list["mode"]) - subspace_transmission = !subspace_transmission - if(!subspace_transmission)//Simple as fuck, clears the channel list to prevent talking/listening over them if subspace transmission is disabled + if(subspace_transmission != 1) + subspace_transmission = 1 + usr << "Subspace Transmission is disabled" + else + subspace_transmission = 0 + usr << "Subspace Transmission is enabled" + if(subspace_transmission == 1)//Simple as fuck, clears the channel list to prevent talking/listening over them if subspace transmission is disabled channels = list() else recalculateChannels() - usr << "Subspace Transmission is [(subspace_transmission) ? "enabled" : "disabled"]" ..() /obj/item/device/radio/borg/interact(mob/user as mob) @@ -785,7 +798,7 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use Toggle Broadcast Mode
"} - if(subspace_transmission)//Don't even bother if subspace isn't turned on + if(!subspace_transmission)//Don't even bother if subspace isn't turned on for (var/ch_name in channels) dat+=text_sec_channel(ch_name, channels[ch_name]) dat+={"[text_wires()]"} @@ -806,4 +819,4 @@ var/GLOBAL_RADIO_TYPE = 1 // radio type to use return /obj/item/device/radio/off - listening = 0 \ No newline at end of file + listening = 0 diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 646a138ce0..be0642ec24 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -155,7 +155,6 @@ modtype = input("Please, select a module!", "Robot", null, null) in modules var/module_sprites[0] //Used to store the associations between sprite names and sprite index. - var/channels = list() if(module) return @@ -177,7 +176,7 @@ if("Miner") module = new /obj/item/weapon/robot_module/miner(src) - channels = list("Supply" = 1) + module.channels = list("Supply" = 1) if(camera && "Robots" in camera.network) camera.network.Add("MINE") module_sprites["Basic"] = "Miner_old" @@ -186,7 +185,7 @@ if("Medical") module = new /obj/item/weapon/robot_module/medical(src) - channels = list("Medical" = 1) + module.channels = list("Medical" = 1) if(camera && "Robots" in camera.network) camera.network.Add("Medical") module_sprites["Basic"] = "Medbot" @@ -196,7 +195,7 @@ if("Security") module = new /obj/item/weapon/robot_module/security(src) - channels = list("Security" = 1) + module.channels = list("Security" = 1) module_sprites["Basic"] = "secborg" module_sprites["Red Knight"] = "Security" module_sprites["Black Knight"] = "securityrobot" @@ -204,7 +203,7 @@ if("Engineering") module = new /obj/item/weapon/robot_module/engineering(src) - channels = list("Engineering" = 1) + module.channels = list("Engineering" = 1) if(camera && "Robots" in camera.network) camera.network.Add("Engineering") module_sprites["Basic"] = "Engineering" @@ -220,7 +219,7 @@ if("Combat") module = new /obj/item/weapon/robot_module/combat(src) module_sprites["Combat Android"] = "droid-combat" - channels = list("Security" = 1) + module.channels = list("Security" = 1) //Custom_sprite check and entry if (custom_sprite == 1) @@ -234,7 +233,7 @@ status_flags &= ~CANPUSH choose_icon(6,module_sprites) - radio.config(channels) + radio.config(module.channels) /mob/living/silicon/robot/proc/updatename(var/prefix as text) if(prefix) @@ -1271,4 +1270,4 @@ triesleft = 0 return else - src << "Your icon has been set. You now require a module reset to change it." \ No newline at end of file + src << "Your icon has been set. You now require a module reset to change it." diff --git a/code/modules/mob/living/silicon/robot/robot_modules.dm b/code/modules/mob/living/silicon/robot/robot_modules.dm index d0fb3bb5fe..ee81e1d57c 100644 --- a/code/modules/mob/living/silicon/robot/robot_modules.dm +++ b/code/modules/mob/living/silicon/robot/robot_modules.dm @@ -5,7 +5,7 @@ w_class = 100.0 item_state = "electronic" flags = FPRINT|TABLEPASS | CONDUCT - + var/channels = list() var/list/modules = list() var/obj/item/emag = null var/obj/item/borg/upgrade/jetpack = null @@ -265,4 +265,4 @@ src.modules += new /obj/item/borg/combat/mobility(src) src.modules += new /obj/item/weapon/wrench(src) //Is a combat android really going to be stopped by a chair? src.emag = new /obj/item/weapon/gun/energy/lasercannon/cyborg(src) - return \ No newline at end of file + return