From 3c00df376adfae695c9a0cd3fc77b095d29f226b Mon Sep 17 00:00:00 2001 From: joep van der velden Date: Tue, 17 Dec 2019 17:11:40 +0100 Subject: [PATCH] inventory slot tweak Clicking on an inventory slot now uses the item there first then tries to equip --- code/_onclick/hud/screen_objects.dm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index c3c9b6f7e65..c0f5cfd5f3b 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -362,7 +362,7 @@ object_overlays += item_overlay add_overlay(object_overlays) -/obj/screen/inventory/Click() +/obj/screen/inventory/Click(location, control, params) // At this point in client Click() code we have passed the 1/10 sec check and little else // We don't even know if it's a middle click if(world.time <= usr.next_move) @@ -371,6 +371,12 @@ return 1 if(istype(usr.loc,/obj/mecha)) // stops inventory actions in a mech return 1 + + if(hud?.mymob && slot_id) + var/obj/item/inv_item = hud.mymob.get_item_by_slot(slot_id) + if(inv_item) + return inv_item.Click(location, control, params) + if(usr.attack_ui(slot_id)) usr.update_inv_l_hand(0) usr.update_inv_r_hand(0)