From 6d3f85a4bb002e01681b64e4aa9463cfc7adca6a Mon Sep 17 00:00:00 2001 From: SmArtKar <44720187+SmArtKar@users.noreply.github.com> Date: Thu, 12 Dec 2024 02:04:40 +0300 Subject: [PATCH] [NO GBP] Fixes toolboxes automatically using the first item, allows placing them on/into tables/racks/closets/crates (#88459) ## About The Pull Request Closes #88446 I swear to god I should stop listening to webedit suggestions ## Changelog :cl: fix: Toolboxes can now be placed onto tables/into crates fix: Fixed toolboxes automatically using the first item in them /:cl: --- code/game/objects/items/storage/toolbox.dm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/code/game/objects/items/storage/toolbox.dm b/code/game/objects/items/storage/toolbox.dm index ea3da60fecc..0374b7a3744 100644 --- a/code/game/objects/items/storage/toolbox.dm +++ b/code/game/objects/items/storage/toolbox.dm @@ -25,6 +25,13 @@ wound_bonus = 5 /// How many interactions are we currently performing var/current_interactions = 0 + /// Items we should not interact with when left clicking + var/static/list/lmb_exception_typecache = typecacheof(list( + /obj/structure/table, + /obj/structure/rack, + /obj/structure/closet, + /obj/machinery/disposal, + )) /obj/item/storage/toolbox/Initialize(mapload) . = ..() @@ -45,6 +52,9 @@ if (user.combat_mode || !user.has_hand_for_held_index(user.get_inactive_hand_index())) return NONE + if (is_type_in_typecache(interacting_with, lmb_exception_typecache) && !LAZYACCESS(modifiers, RIGHT_CLICK)) + return NONE + if (current_interactions) var/obj/item/other_tool = user.get_inactive_held_item() if (!istype(other_tool)) // what even @@ -60,7 +70,6 @@ for (var/obj/item/tool in atom_storage.real_location) if(is_type_in_list(tool, GLOB.tool_items)) item_radial[tool] = tool.appearance - break if (!length(item_radial)) return NONE