From 897de881b33776dbbded3bcfde5b8d77a87f97c0 Mon Sep 17 00:00:00 2001 From: CHOMPStation2StaffMirrorBot <94713762+CHOMPStation2StaffMirrorBot@users.noreply.github.com> Date: Sun, 12 Apr 2026 23:08:38 -0700 Subject: [PATCH] [MIRROR] Fixes some click bugs (#12673) Co-authored-by: Cameron Lennox --- code/game/machinery/doors/airlock.dm | 11 ++++++----- code/modules/mob/inventory.dm | 21 ++++++++++++--------- code/modules/vehicles/bike.dm | 17 +++++++++++------ 3 files changed, 29 insertions(+), 20 deletions(-) diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index de4161c177..e6b57ade4c 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -558,10 +558,10 @@ About the new airlock wires panel: /obj/machinery/door/airlock/click_ctrl(mob/user) //Hold door open user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN) if(user.is_incorporeal()) - return + return CLICK_ACTION_BLOCKING if(!Adjacent(user)) - return + return CLICK_ACTION_BLOCKING if(user.a_intent == I_HURT) visible_message(span_warning("[user] hammers on \the [src]!"), span_warning("Someone hammers loudly on \the [src]!")) @@ -569,13 +569,13 @@ About the new airlock wires panel: if(icon_state == "door_closed" && arePowerSystemsOn()) flick("door_deny", src) playsound(src, knock_hammer_sound, 50, 0, 3) - return + return CLICK_ACTION_SUCCESS if(user.a_intent == I_GRAB) //Hold door open hold_open = user visible_message(span_info("[user] begins holding \the [src] open."), span_info("Someone has started holding \the [src] open.")) attack_hand(user) - return + return CLICK_ACTION_SUCCESS if(arePowerSystemsOn()) if(isElectrified()) @@ -590,11 +590,12 @@ About the new airlock wires panel: if(icon_state == "door_closed") flick("door_deny", src) playsound(src, knock_sound, 50, 0, 3) - return + return CLICK_ACTION_SUCCESS visible_message(span_info("[user] knocks on \the [src]."), span_info("Someone knocks on \the [src].")) add_fingerprint(user) playsound(src, knock_unpowered_sound, 50, 0, 3) + return CLICK_ACTION_SUCCESS /obj/machinery/door/airlock/tgui_act(action, params, datum/tgui/ui) if(..()) diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index 4239e37fe9..3e0617861e 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -32,18 +32,21 @@ GLOBAL_LIST_INIT(slot_equipment_priority, list( * on the item in the slot if the users active hand is empty */ /mob/proc/attack_ui(slot, params) - var/obj/item/W = get_active_held_item() + var/obj/item/active_item = get_active_held_item() + var/obj/item/equipped_item = get_item_by_slot(slot) + var/list/modifiers = params2list(params) - if(istype(W)) - if(equip_to_slot_if_possible(W, slot,0,0,0)) + if(istype(equipped_item)) + if(active_item) + equipped_item.attackby(active_item, src) //Wearing an item and item in hand. return TRUE - if(!W) - // Activate the item - var/obj/item/I = get_item_by_slot(slot) - if(istype(I)) - var/list/modifiers = params2list(params) - I.attack_hand(src, modifiers) + equipped_item.attack_hand(src, modifiers) //Wearing an item w/ no item in hand. + return TRUE + + if(istype(active_item)) + if(equip_to_slot_if_possible(active_item, slot,0,0,0)) //NOT wearing an item, but DO have item in hand. + return TRUE return FALSE diff --git a/code/modules/vehicles/bike.dm b/code/modules/vehicles/bike.dm index 46168c84df..d7dc0c2cba 100644 --- a/code/modules/vehicles/bike.dm +++ b/code/modules/vehicles/bike.dm @@ -57,7 +57,7 @@ /obj/vehicle/bike/click_ctrl(mob/user) if(Adjacent(user) && anchored) - toggle() + return toggle_proc(user) else return ..() @@ -65,18 +65,23 @@ set name = "Toggle Engine" set category = "Object.Vehicle" //ChompEDIT - TGPanel set src in view(0) + toggle_proc(usr) - if(!isliving(usr) || HAS_TRAIT(usr, TRAIT_AMBIENT_PEST_MOB)) - return +/obj/vehicle/bike/proc/toggle_proc(mob/user) + if(!isliving(user) || HAS_TRAIT(user, TRAIT_AMBIENT_PEST_MOB)) + return CLICK_ACTION_BLOCKING - if(usr.incapacitated()) return + if(user.incapacitated()) + return CLICK_ACTION_BLOCKING if(!on && cell && cell.charge > charge_use) turn_on() - src.visible_message("\The [src] rumbles to life.", "You hear something rumble deeply.") + visible_message("\The [src] rumbles to life.", "You hear something rumble deeply.") + return CLICK_ACTION_SUCCESS else turn_off() - src.visible_message("\The [src] putters before turning off.", "You hear something putter slowly.") + visible_message("\The [src] putters before turning off.", "You hear something putter slowly.") + return CLICK_ACTION_SUCCESS /obj/vehicle/bike/click_alt(var/mob/user) if(Adjacent(user))