From 2d80c8ec6955e75b49c5210e92a397af8510c68f Mon Sep 17 00:00:00 2001 From: Luc <89928798+lewcc@users.noreply.github.com> Date: Wed, 16 Aug 2023 12:06:02 -0700 Subject: [PATCH] Prevents radios from working in certain admin areas (#21847) * Add blacklisted areas for tcomms cores * Blacklists some areas from tcomm cores * this is better * Update code/game/machinery/tcomms/tcomms_core.dm Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com> --------- Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com> --- .../objects/items/devices/radio/radio_objects.dm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/code/game/objects/items/devices/radio/radio_objects.dm b/code/game/objects/items/devices/radio/radio_objects.dm index 42e0e044e24..5dff77d0704 100644 --- a/code/game/objects/items/devices/radio/radio_objects.dm +++ b/code/game/objects/items/devices/radio/radio_objects.dm @@ -58,6 +58,8 @@ GLOBAL_LIST_INIT(default_medbay_channels, list( var/obj/item/encryptionkey/syndicate/syndiekey = null /// How many times this is disabled by EMPs var/disable_timer = 0 + /// Areas in which this radio cannot send messages + var/static/list/blacklisted_areas = list(/area/adminconstruction, /area/tdome) flags = CONDUCT slot_flags = SLOT_BELT @@ -262,6 +264,11 @@ GLOBAL_LIST_INIT(default_medbay_channels, list( else connection = radio_connection channel = null + + if(is_type_in_list(get_area(src), blacklisted_areas)) + // add a debug log so people testing things won't be fighting against a "broken" radio for too long. + log_debug("Radio message from [src] was used in restricted area [get_area(src)].") + return if(!istype(connection)) return if(!connection) @@ -360,6 +367,11 @@ GLOBAL_LIST_INIT(default_medbay_channels, list( if(!M.IsVocal()) return 0 + if(is_type_in_list(get_area(src), blacklisted_areas)) + // add a debug log so people testing things won't be fighting against a "broken" radio for too long. + log_debug("Radio message from [src] was used in restricted area [get_area(src)].") + return FALSE + var/jammed = FALSE var/turf/position = get_turf(src) for(var/J in GLOB.active_jammers)