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>
This commit is contained in:
S34N
2022-09-07 13:36:40 +01:00
committed by GitHub
co-authored by AffectedArc07
parent 7d9213e0c2
commit ea0c492094
3 changed files with 15 additions and 2 deletions
+8 -1
View File
@@ -43,6 +43,13 @@
visible_message("<span class='warning'>Error: Another core is already active in this sector. Power-up cancelled due to radio interference.</span>")
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
+4
View File
@@ -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()
@@ -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