From c49ba598fca7e29d5b1e124123c7cd5b57640bb0 Mon Sep 17 00:00:00 2001 From: GoblinBackwards <22856555+GoblinBackwards@users.noreply.github.com> Date: Mon, 24 Jun 2024 22:03:51 +0100 Subject: [PATCH] Fixes some objects not being pulled with ctrl-click (#84190) ## About The Pull Request Fix for a bug where using ctrl-click to try to pull the bluespace gas sender and hydroponics tray isn't working. Seems to be broken since the ctrl-click refactor. Fixes #84222 ## Changelog :cl: fix: Fixed ctrl-click not dragging the bluespace gas sender or hydroponics trays. /:cl: --- .../machinery/components/unary_devices/bluespace_sender.dm | 5 +++-- code/modules/hydroponics/hydroponics.dm | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/code/modules/atmospherics/machinery/components/unary_devices/bluespace_sender.dm b/code/modules/atmospherics/machinery/components/unary_devices/bluespace_sender.dm index 6957389c351..ebe053663f9 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/bluespace_sender.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/bluespace_sender.dm @@ -61,7 +61,8 @@ GLOBAL_LIST_EMPTY_TYPED(bluespace_senders, /obj/machinery/atmospherics/component /obj/machinery/atmospherics/components/unary/bluespace_sender/add_context(atom/source, list/context, obj/item/held_item, mob/user) . = ..() - context[SCREENTIP_CONTEXT_CTRL_LMB] = "Turn [on ? "off" : "on"]" + if(anchored && !panel_open && is_operational) + context[SCREENTIP_CONTEXT_CTRL_LMB] = "Turn [on ? "off" : "on"]" if(!held_item) return CONTEXTUAL_SCREENTIP_SET switch(held_item.tool_behaviour) @@ -156,7 +157,7 @@ GLOBAL_LIST_EMPTY_TYPED(bluespace_senders, /obj/machinery/atmospherics/component investigate_log("was turned [on ? "on" : "off"] by [key_name(user)]", INVESTIGATE_ATMOS) update_appearance() return CLICK_ACTION_SUCCESS - return CLICK_ACTION_BLOCKING + return NONE /obj/machinery/atmospherics/components/unary/bluespace_sender/ui_interact(mob/user, datum/tgui/ui) ui = SStgui.try_update_ui(user, src, ui) diff --git a/code/modules/hydroponics/hydroponics.dm b/code/modules/hydroponics/hydroponics.dm index 3f47982e16e..791b7ac51a2 100644 --- a/code/modules/hydroponics/hydroponics.dm +++ b/code/modules/hydroponics/hydroponics.dm @@ -1088,12 +1088,12 @@ user.examinate(src) /obj/machinery/hydroponics/click_ctrl(mob/user) + if(!anchored) + return NONE if(!powered()) to_chat(user, span_warning("[name] has no power.")) update_use_power(NO_POWER_USE) return CLICK_ACTION_BLOCKING - if(!anchored) - return CLICK_ACTION_BLOCKING set_self_sustaining(!self_sustaining) to_chat(user, span_notice("You [self_sustaining ? "activate" : "deactivated"] [src]'s autogrow function[self_sustaining ? ", maintaining the tray's health while using high amounts of power" : ""].")) return CLICK_ACTION_SUCCESS