Revert #25303 and subsequent fixes (#25613)

* Revert "Be safe, radios. (#25595)"

This reverts commit bfa88abd5a.

* Revert "Fixes various radio issues (#25586)"

This reverts commit 9296564ab6.

* Revert "refactors radios to use proximity (#25303)"

This reverts commit 06db6bc004.

* One more bit that needed reverting.

* Begone, unnecessary file!

---------

Co-authored-by: FunnyMan3595 (Charlie Nolan) <funnyman@google.com>
This commit is contained in:
Charlie Nolan
2024-05-24 04:42:53 +00:00
committed by GitHub
co-authored by FunnyMan3595
parent 03cca11f95
commit 82a1cc6a4e
8 changed files with 52 additions and 89 deletions
@@ -60,8 +60,6 @@ GLOBAL_LIST_EMPTY(deadsay_radio_systems)
var/obj/item/encryptionkey/syndicate/syndiekey = null
/// How many times this is disabled by EMPs
var/disable_timer = 0
/// List of all the mobs that can hear this radio
var/list/listeners = list()
/// Areas in which this radio cannot send messages
var/static/list/blacklisted_areas = list(/area/adminconstruction, /area/tdome, /area/ruin/space/bubblegum_arena)
@@ -84,6 +82,7 @@ GLOBAL_LIST_EMPTY(deadsay_radio_systems)
var/requires_tcomms = FALSE // Does this device require tcomms to work.If TRUE it wont function at all without tcomms. If FALSE, it will work without tcomms, just slowly
var/instant = FALSE // Should this device instantly communicate if there isnt tcomms
/obj/item/radio/proc/set_frequency(new_frequency)
SSradio.remove_object(src, frequency)
frequency = new_frequency
@@ -98,7 +97,6 @@ GLOBAL_LIST_EMPTY(deadsay_radio_systems)
/obj/item/radio/Destroy()
SStgui.close_uis(wires)
listeners.Cut()
QDEL_NULL(wires)
if(SSradio)
SSradio.remove_object(src, frequency)
@@ -117,31 +115,6 @@ GLOBAL_LIST_EMPTY(deadsay_radio_systems)
for(var/ch_name in channels)
secure_radio_connections[ch_name] = SSradio.add_object(src, SSradio.radiochannels[ch_name], RADIO_CHAT)
if(canhear_range)
AddComponent(/datum/component/proximity_monitor, canhear_range)
/obj/item/radio/HasProximity(mob/crosser)
if(!istype(crosser) || (crosser in listeners))
return
listeners += crosser
RegisterSignal(crosser, COMSIG_MOVABLE_MOVED, PROC_REF(is_crosser_still_listening))
RegisterSignal(crosser, COMSIG_PARENT_QDELETING, PROC_REF(remove_from_listener_list))
/obj/item/radio/proc/is_crosser_still_listening(mob/crosser)
SIGNAL_HANDLER // COMSIG_MOVABLE_MOVED
var/still_listening = FALSE
for(var/obj/effect/abstract/proximity_checker/checker in get_turf(crosser))
if(checker.monitor.hasprox_receiver == src)
still_listening = TRUE
break
if(still_listening)
return
remove_from_listener_list(crosser)
/obj/item/radio/proc/remove_from_listener_list(mob/crosser)
SIGNAL_HANDLER // COMSIG_PARENT_QDELETING
listeners -= crosser
UnregisterSignal(crosser, list(COMSIG_PARENT_QDELETING, COMSIG_MOVABLE_MOVED))
/obj/item/radio/attack_ghost(mob/user)
return interact(user)
@@ -236,26 +209,14 @@ GLOBAL_LIST_EMPTY(deadsay_radio_systems)
if(has_loudspeaker)
loudspeaker = !loudspeaker
if(loudspeaker)
update_hear_range(3)
canhear_range = 3
else
update_hear_range(0)
canhear_range = 0
else
. = FALSE
if(.)
add_fingerprint(usr)
/obj/item/radio/proc/update_hear_range(new_hear_range)
canhear_range = new_hear_range
var/datum/component/proximity_monitor/our_prox_component = GetComponent(/datum/component/proximity_monitor)
if(!canhear_range)
QDEL_NULL(our_prox_component)
return
if(our_prox_component)
our_prox_component.set_radius(canhear_range)
else
AddComponent(/datum/component/proximity_monitor, canhear_range)
/obj/item/radio/proc/list_secure_channels(mob/user)
var/list/dat = list()
for(var/channel in channels)
@@ -576,7 +537,9 @@ GLOBAL_LIST_EMPTY(deadsay_radio_systems)
/obj/item/radio/proc/send_announcement()
if(is_listening())
return listeners
return get_mobs_in_view(canhear_range, src)
return null
/obj/item/radio/examine(mob/user)
. = ..()
@@ -844,16 +807,3 @@ GLOBAL_LIST_EMPTY(deadsay_radio_systems)
return
return M.say_dead(message)
GLOBAL_DATUM_INIT(deadchat_radio, /obj/item/radio/dchat_radio_handler, new())
/obj/item/radio/dchat_radio_handler
name = "Deadchat radio handler. Do not fuck with"
canhear_range = 0
/obj/item/radio/dchat_radio_handler/Destroy(force)
. = ..()
stack_trace("Someone just tried to delete the deadchat handler!")
if(!force)
return QDEL_HINT_LETMELIVE
return ..()