Fix intercoms again hopefully (#15458)

This commit is contained in:
Wildkins
2022-12-28 12:49:33 +01:00
committed by GitHub
parent 0c7cbecc2f
commit 025e9f80a5
2 changed files with 6 additions and 2 deletions
@@ -175,6 +175,9 @@
INVOKE_ASYNC(src, /obj/item/.proc/attack_self, user)
/obj/item/device/radio/intercom/can_receive(input_frequency, list/levels)
if(!listening)
return FALSE
if(levels != RADIO_NO_Z_LEVEL_RESTRICTION)
var/turf/position = get_turf(src)
if(!istype(position) || !(position.z in levels))
@@ -89,8 +89,6 @@ var/global/list/default_medbay_channels = list(
SSradio.remove_object(src, frequency)
if(new_frequency)
frequency = new_frequency
if(listening && on)
radio_connection = SSradio.add_object(src, new_frequency, RADIO_CHAT)
/obj/item/device/radio/Initialize()
@@ -475,6 +473,9 @@ var/global/list/default_medbay_channels = list(
/obj/item/device/radio/proc/can_receive(input_frequency, list/levels)
// check if the radio can receive on the given frequency
if (!listening)
return
if (levels != RADIO_NO_Z_LEVEL_RESTRICTION)
var/turf/position = get_turf(src)
if (!position || !(position.z in levels))