From 0400795c1e7c6fabe1ec9e64970a8b2c5e8e6b55 Mon Sep 17 00:00:00 2001 From: CHOMPStation2StaffMirrorBot <94713762+CHOMPStation2StaffMirrorBot@users.noreply.github.com> Date: Sun, 16 Feb 2025 02:39:02 -0700 Subject: [PATCH] [MIRROR] Adds the ability to use storage in storage (#10187) Co-authored-by: Cameron Lennox --- code/__defines/inventory_storage.dm | 2 -- code/_onclick/click.dm | 4 ++-- code/modules/detectivework/tools/evidencebag.dm | 4 ++-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/code/__defines/inventory_storage.dm b/code/__defines/inventory_storage.dm index 359108bce2..d53e3bb556 100644 --- a/code/__defines/inventory_storage.dm +++ b/code/__defines/inventory_storage.dm @@ -24,7 +24,5 @@ #define INVENTORY_DUFFLEBAG_SPACE ITEMSIZE_COST_NORMAL * 9 // 36 #define INVENTORY_BOX_SPACE ITEMSIZE_COST_SMALL * 7 // 14 -// CHOMPedit start. //this all needs a refactor to tg storage but for now... #define MAX_STORAGE_REACH 2 //maximum you can reach down to grab things from storage. -// CHOMPedit end. diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index 89d6132361..e81b07b179 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -105,7 +105,7 @@ //Atoms on your person // A is your location but is not a turf; or is on you (backpack); or is on something on you (box in backpack); sdepth is needed here because contents depth does not equate inventory storage depth. var/sdepth = A.storage_depth(src) - if(!currently_restrained && ((!isturf(A) && A == loc) || (sdepth <= MAX_STORAGE_REACH))) // CHOMPedit: Boxes can be interacted with inside of larger inventories. + if(!currently_restrained && ((!isturf(A) && A == loc) || (sdepth <= MAX_STORAGE_REACH))) if(W) var/resolved = W.resolve_attackby(A, src, click_parameters = params) if(!resolved && A && W) @@ -137,7 +137,7 @@ //Atoms on turfs (not on your person) // A is a turf or is on a turf, or in something on a turf (pen in a box); but not something in something on a turf (pen in a box in a backpack) sdepth = A.storage_depth_turf() - if(isturf(A) || isturf(A.loc) || (sdepth <= MAX_STORAGE_REACH)) // CHOMPedit: Storage reach depth. + if(isturf(A) || isturf(A.loc) || (sdepth <= MAX_STORAGE_REACH)) if(currently_restrained) if(ismob(A) && A.Adjacent(src)) //We are RESTRAINED (handcuffed or otherwise) and ADJACENT setClickCooldown(get_attack_speed()) diff --git a/code/modules/detectivework/tools/evidencebag.dm b/code/modules/detectivework/tools/evidencebag.dm index cf56d351d6..10c8f83409 100644 --- a/code/modules/detectivework/tools/evidencebag.dm +++ b/code/modules/detectivework/tools/evidencebag.dm @@ -2,7 +2,7 @@ /obj/item/evidencebag name = "evidence bag" - desc = "An empty evidence bag. Use by clicking on the bag and dragging it to the item you want to bag." //CHOMPstation edit-"Actually clarifies how to use the item in game" + desc = "An empty evidence bag. Use by clicking on the bag and dragging it to the item you want to bag." icon = 'icons/obj/storage.dmi' icon_state = "evidenceobj" item_state = null @@ -27,7 +27,7 @@ //If it isn't on the floor. Do some checks to see if it's in our hands or a box. Otherwise give up. if(istype(I.loc,/obj/item/storage)) //in a container. var/sdepth = I.storage_depth(user) - if (sdepth > MAX_STORAGE_REACH) // CHOMPedit: Storage reach depth. + if (sdepth > MAX_STORAGE_REACH) return //too deeply nested to access var/obj/item/storage/U = I.loc