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 1/2] 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! From 4f66a13179ababfaacf08322d2170aa2cb204075 Mon Sep 17 00:00:00 2001 From: GenericDM <34109002+GenericDM@users.noreply.github.com> Date: Sun, 17 Dec 2023 23:47:47 -0800 Subject: [PATCH 2/2] document --- code/game/objects/structures/crateshelf.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/game/objects/structures/crateshelf.dm b/code/game/objects/structures/crateshelf.dm index 30e9ed514c20..a2234cc45ad9 100644 --- a/code/game/objects/structures/crateshelf.dm +++ b/code/game/objects/structures/crateshelf.dm @@ -24,7 +24,7 @@ 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)) - if(i >= 3) + if(i >= 3) // If we're at or above three, we'll be on the way to going off the tile we're on. This allows mobs to be below the shelf when this happens. 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. @@ -88,7 +88,7 @@ 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. - if(next_free >= 3) + if(next_free >= 3) // If we're at or above three, we'll be on the way to going off the tile we're on. This allows mobs to be below the crate when this happens. 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.