From c8f98337a45678f272bcfd189ba7b99403c6886e Mon Sep 17 00:00:00 2001 From: Ccomp5950 Date: Mon, 28 Apr 2014 02:50:38 -0500 Subject: [PATCH] Radio :r and :l fixes and feature. If you have a hand held radio in your right hand and use :r it will send through it. If you have a radio on both ears and no radio in your hand and use :r it will use the right side ear radio. Priority is given to the radio in the hand over the ear but this fix should make both side happy, those that want it to be ears and those tht want it to be hand helds. --- code/modules/mob/living/carbon/human/say.dm | 26 ++++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/code/modules/mob/living/carbon/human/say.dm b/code/modules/mob/living/carbon/human/say.dm index 8dcd2bb108d..f5f61ff8668 100644 --- a/code/modules/mob/living/carbon/human/say.dm +++ b/code/modules/mob/living/carbon/human/say.dm @@ -75,17 +75,31 @@ used_radios += r_ear if("right_ear") + var/obj/item/device/radio/R + var/has_radio = 0 if(r_ear && istype(r_ear,/obj/item/device/radio)) - var/obj/item/device/radio/R = r_ear - R.talk_into(src,message,verb,speaking) - used_radios += r_ear + R = r_ear + has_radio = 1 + if(r_hand && istype(r_hand, /obj/item/device/radio)) + R = r_hand + has_radio = 1 + if(has_radio) + R.talk_into(src,message,null,verb,speaking) + used_radios += R if("left_ear") + var/obj/item/device/radio/R + var/has_radio = 0 if(l_ear && istype(l_ear,/obj/item/device/radio)) - var/obj/item/device/radio/R = l_ear - R.talk_into(src,message,verb,speaking) - used_radios += l_ear + R = l_ear + has_radio = 1 + if(l_hand && istype(l_hand,/obj/item/device/radio)) + R = l_hand + has_radio = 1 + if(has_radio) + R.talk_into(src,message,null,verb,speaking) + used_radios += R if("intercom") for(var/obj/item/device/radio/intercom/I in view(1, null))