From d598d4ff3b105d7600f6012f04ba09fb15115a91 Mon Sep 17 00:00:00 2001 From: SmArtKar <44720187+SmArtKar@users.noreply.github.com> Date: Wed, 14 Aug 2024 14:21:30 +0300 Subject: [PATCH] Integrated circuit modules now can be linked to component printers (#85519) ## About The Pull Request Title. They've been missing quick component addition functionality due to an oversight and were rather annoying to use. ## Why It's Good For The Game Simple QOL, you no longer need to add every piece manually and can develop circuits as actually intended (fully from their UI, as you can do with primary circuits themselves) ## Changelog :cl: qol: Integrated circuit modules now can be linked to component printers /:cl: --- .../modules/wiremod/core/component_printer.dm | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/code/modules/wiremod/core/component_printer.dm b/code/modules/wiremod/core/component_printer.dm index 3bfdb519c9b..45f71ceb617 100644 --- a/code/modules/wiremod/core/component_printer.dm +++ b/code/modules/wiremod/core/component_printer.dm @@ -192,13 +192,22 @@ return data /obj/machinery/component_printer/attackby(obj/item/weapon, mob/living/user, params) - if(istype(weapon, /obj/item/integrated_circuit) && !user.combat_mode) - var/obj/item/integrated_circuit/circuit = weapon - circuit.linked_component_printer = WEAKREF(src) - circuit.update_static_data_for_all_viewers() - balloon_alert(user, "successfully linked to the integrated circuit") - return - return ..() + if (user.combat_mode) + return ..() + + var/obj/item/integrated_circuit/circuit + if(istype(weapon, /obj/item/integrated_circuit)) + circuit = weapon + else if (istype(weapon, /obj/item/circuit_component/module)) + var/obj/item/circuit_component/module/module = weapon + circuit = module.internal_circuit + if (isnull(circuit)) + return ..() + + circuit.linked_component_printer = WEAKREF(src) + circuit.update_static_data_for_all_viewers() + balloon_alert(user, "successfully linked to the integrated circuit") + /obj/machinery/component_printer/crowbar_act(mob/living/user, obj/item/tool) if(..())