From f67090e606cc2d7791b13f113203f4b757c793cd Mon Sep 17 00:00:00 2001 From: GenericDM <34109002+GenericDM@users.noreply.github.com> Date: Sun, 17 Dec 2023 21:23:52 -0800 Subject: [PATCH] crateshelffix --- code/game/objects/structures/crateshelf.dm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/code/game/objects/structures/crateshelf.dm b/code/game/objects/structures/crateshelf.dm index 1ede60f12e22..30e9ed514c20 100644 --- a/code/game/objects/structures/crateshelf.dm +++ b/code/game/objects/structures/crateshelf.dm @@ -24,7 +24,10 @@ var/stack_layer // This is used to generate the sprite layering of the shelf pieces. var/stack_offset // This is used to generate the vertical offset of the shelf pieces. for(var/i in 1 to (capacity - 1)) - stack_layer = BELOW_OBJ_LAYER + (0.02 * i) - 0.01 // Make each shelf piece render above the last, but below the crate that should be on it. + if(i >= 3) + stack_layer = ABOVE_MOB_LAYER + (0.02 * i) - 0.01 + else + stack_layer = BELOW_OBJ_LAYER + (0.02 * i) - 0.01 // Make each shelf piece render above the last, but below the crate that should be on it. stack_offset = DEFAULT_SHELF_VERTICAL_OFFSET * i // Make each shelf piece physically above the last. overlays += image(icon = 'icons/obj/objects.dmi', icon_state = "shelf_stack", layer = stack_layer, pixel_y = stack_offset) return @@ -85,7 +88,10 @@ shelf_contents[next_free] = crate // Insert a reference to the crate into the free slot. crate.forceMove(src) // Insert the crate into the shelf. crate.pixel_y = DEFAULT_SHELF_VERTICAL_OFFSET * (next_free - 1) // Adjust the vertical offset of the crate to look like it's on the shelf. - crate.layer = BELOW_OBJ_LAYER + 0.02 * (next_free - 1) // Adjust the layer of the crate to look like it's in the shelf. + if(next_free >= 3) + crate.layer = ABOVE_MOB_LAYER + 0.02 * (next_free - 1) + else + crate.layer = BELOW_OBJ_LAYER + 0.02 * (next_free - 1) // Adjust the layer of the crate to look like it's in the shelf. handle_visuals() return TRUE return FALSE // If the do_after() is interrupted, return FALSE!