diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index 6d6374641ea..d06f0d76f53 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -603,11 +603,11 @@ /obj/item/radio/borg/resetChannels() . = ..() - - var/mob/living/silicon/robot/R = loc - if(istype(R)) - for(var/ch_name in R.model.radio_channels) - channels[ch_name] = TRUE + if (!iscyborg(loc)) + return + var/mob/living/silicon/robot/borg = loc + for(var/ch_name in borg.model.radio_channels) + channels[ch_name] = TRUE /obj/item/radio/borg/syndicate special_channels = RADIO_SPECIAL_SYNDIE @@ -619,37 +619,38 @@ /obj/item/radio/borg/screwdriver_act(mob/living/user, obj/item/tool) if(!keyslot) - to_chat(user, span_warning("This radio doesn't have any encryption keys!")) + loc.balloon_alert(user, "no encryption keys!") return for(var/ch_name in channels) SSradio.remove_object(src, GLOB.radiochannels[ch_name]) secure_radio_connections[ch_name] = null - if(keyslot) - var/turf/user_turf = get_turf(user) - if(user_turf) - keyslot.forceMove(user_turf) - keyslot = null + if (!user.put_in_hands(keyslot)) + keyslot.forceMove(drop_location()) + keyslot = null recalculateChannels() - to_chat(user, span_notice("You pop out the encryption key in the radio.")) + loc.balloon_alert(user, "encryption key removed") return ..() -/obj/item/radio/borg/attackby(obj/item/attacking_item, mob/user, params) +/obj/item/radio/borg/item_interaction(mob/living/user, obj/item/tool, list/modifiers) + if (!istype(tool, /obj/item/encryptionkey)) + return NONE - if(istype(attacking_item, /obj/item/encryptionkey)) - if(keyslot) - to_chat(user, span_warning("The radio can't hold another key!")) - return + if(keyslot) + loc.balloon_alert(user, "cannot hold another key!") + return ITEM_INTERACT_BLOCKING - if(!keyslot) - if(!user.transferItemToLoc(attacking_item, src)) - return - keyslot = attacking_item - - recalculateChannels() + if(!user.transferItemToLoc(tool, src)) + loc.balloon_alert(user, "cannot install!") + return ITEM_INTERACT_BLOCKING + keyslot = tool + recalculateChannels() + playsound(src, 'sound/machines/click.ogg', 50, TRUE) + loc.balloon_alert(user, "encryption key installed") + return ITEM_INTERACT_SUCCESS /obj/item/radio/off // Station bounced radios, their only difference is spawning with the speakers off, this was made to help the lag. dog_fashion = /datum/dog_fashion/back