From 79bd10034a23dfe785abc3a0408e57de24d809d4 Mon Sep 17 00:00:00 2001 From: AffectedArc07 Date: Tue, 21 Jul 2020 10:40:26 +0100 Subject: [PATCH] Tcomms fixes and tweaks (#13880) * Tcomms fixes and tweaks * Grammar --- code/game/machinery/tcomms/_base.dm | 32 +++++++++++++++++++++++++++++ code/game/machinery/tcomms/core.dm | 1 + code/game/machinery/tcomms/relay.dm | 1 + 3 files changed, 34 insertions(+) diff --git a/code/game/machinery/tcomms/_base.dm b/code/game/machinery/tcomms/_base.dm index dc933099faa..05c7552aacc 100644 --- a/code/game/machinery/tcomms/_base.dm +++ b/code/game/machinery/tcomms/_base.dm @@ -52,6 +52,19 @@ GLOBAL_LIST_EMPTY(tcomms_machines) . = ..() GLOB.tcomms_machines += src update_icon() + if((!mapload) && (usr)) + // To the person who asks "Hey affected, why are you using this massive operator when you can use AREACOORD?" Well, ill tell you + // get_area_name is fucking broken and uses a for(x in world) search + // It doesnt even work, is expensive, and returns 0 + // Im not refactoring one thing which could risk breaking all admin location logs + // Fight me + log_action(usr, "constructed a new [src] at [src ? "[get_location_name(src, TRUE)] [COORD(src)]" : "nonexistent location"] [ADMIN_JMP(src)]", adminmsg = TRUE) + // Add in component parts for the sake of deconstruction + component_parts = list() + component_parts += new /obj/item/stock_parts/manipulator(null) + component_parts += new /obj/item/stock_parts/manipulator(null) + component_parts += new /obj/item/stack/cable_coil(null, 1) + component_parts += new /obj/item/stack/cable_coil(null, 1) /** * Base Destructor @@ -60,6 +73,8 @@ GLOBAL_LIST_EMPTY(tcomms_machines) */ /obj/machinery/tcomms/Destroy() GLOB.tcomms_machines -= src + if(usr) + log_action(usr, "destroyed a [src] at [src ? "[get_location_name(src, TRUE)] [COORD(src)]" : "nonexistent location"] [ADMIN_JMP(src)]", adminmsg = TRUE) return ..() /** @@ -462,3 +477,20 @@ GLOBAL_LIST_EMPTY(tcomms_machines) break return ..() +/** + * Screwdriver Act Handler + * + * Handles the screwdriver action for all tcomms machines, so they can be open and closed to be deconstructed + */ +/obj/machinery/tcomms/screwdriver_act(mob/user, obj/item/I) + . = TRUE + default_deconstruction_screwdriver(user, icon_state, icon_state, I) + +/** + * Crowbar Act Handler + * + * Handles the crowbar action for all tcomms machines, so they can be deconstructed + */ +/obj/machinery/tcomms/crowbar_act(mob/user, obj/item/I) + . = TRUE + default_deconstruction_crowbar(user, I) diff --git a/code/game/machinery/tcomms/core.dm b/code/game/machinery/tcomms/core.dm index 88846a5de33..46cd0e6df71 100644 --- a/code/game/machinery/tcomms/core.dm +++ b/code/game/machinery/tcomms/core.dm @@ -34,6 +34,7 @@ . = ..() link_password = GenerateKey() reachable_zlevels |= loc.z + component_parts += new /obj/item/circuitboard/tcomms/core(null) /** * Destructor for the core. diff --git a/code/game/machinery/tcomms/relay.dm b/code/game/machinery/tcomms/relay.dm index 2cd2a44b1af..b2faf9ce0cd 100644 --- a/code/game/machinery/tcomms/relay.dm +++ b/code/game/machinery/tcomms/relay.dm @@ -25,6 +25,7 @@ */ /obj/machinery/tcomms/relay/Initialize(mapload) . = ..() + component_parts += new /obj/item/circuitboard/tcomms/relay(null) if(mapload && autolink_id) return INITIALIZE_HINT_LATELOAD