From ea0c49209416387b2bca883d278f4be372be1877 Mon Sep 17 00:00:00 2001 From: S34N <12197162+S34NW@users.noreply.github.com> Date: Wed, 7 Sep 2022 13:36:40 +0100 Subject: [PATCH] CC tcomms QoL (#18827) * auto-relinking! * makes these work everywhere * makes it clearer this is a UID * works * fix * Update code/game/machinery/tcomms/presets.dm Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com> Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com> --- code/game/machinery/tcomms/core.dm | 9 ++++++++- code/game/machinery/tcomms/presets.dm | 4 ++++ code/game/objects/items/devices/radio/radio.dm | 4 +++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/code/game/machinery/tcomms/core.dm b/code/game/machinery/tcomms/core.dm index 12650996e89..a072f9dd55c 100644 --- a/code/game/machinery/tcomms/core.dm +++ b/code/game/machinery/tcomms/core.dm @@ -43,6 +43,13 @@ visible_message("Error: Another core is already active in this sector. Power-up cancelled due to radio interference.") update_icon() + if(mapload) //Automatically links new midround tcomms cores to the cc relay + return + var/obj/machinery/tcomms/relay/cc/cc_relay = locateUID(GLOB.cc_tcomms_relay_uid) + if(cc_relay?.linked_core) //if we are already linked, ignore! + return + cc_relay.AddLink(src) + /** * Destructor for the core. * @@ -99,7 +106,7 @@ return TRUE // Now we generate the list of where that signal should go to - tcm.zlevels = reachable_zlevels + tcm.zlevels = reachable_zlevels.Copy() tcm.zlevels |= tcm.source_level // Now check if they actually have pieces, if so, broadcast diff --git a/code/game/machinery/tcomms/presets.dm b/code/game/machinery/tcomms/presets.dm index 580bf080116..647ef13c359 100644 --- a/code/game/machinery/tcomms/presets.dm +++ b/code/game/machinery/tcomms/presets.dm @@ -31,3 +31,7 @@ hidden_link = TRUE password_bypass = TRUE +GLOBAL_VAR(cc_tcomms_relay_uid) +/obj/machinery/tcomms/relay/cc/Initialize(mapload) + . = ..() + GLOB.cc_tcomms_relay_uid = UID() diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm index d282899d0ea..bb37a165248 100644 --- a/code/game/objects/items/devices/radio/radio.dm +++ b/code/game/objects/items/devices/radio/radio.dm @@ -464,7 +464,9 @@ GLOBAL_LIST_INIT(default_medbay_channels, list( // Simulate two seconds of lag addtimer(CALLBACK(src, .proc/broadcast_callback, tcm), 2 SECONDS) else - // Nukeops + Deathsquad headsets are instant and should work the same, whether there is comms or not + // Nukeops + Deathsquad headsets are instant and should work the same, whether there is comms or not, on all z levels + for(var/z in 1 to world.maxz) + tcm.zlevels |= z broadcast_message(tcm) qdel(tcm) // Delete the message datum return TRUE