Merge pull request #14066 from Heroman3003/sofix

Hopefully fixes corner sofas
This commit is contained in:
Casey
2022-11-13 15:47:34 -05:00
committed by CHOMPStation2
parent 8c16cf9e16
commit 191657472b
2 changed files with 13 additions and 1 deletions

View File

@@ -299,7 +299,7 @@
/obj/structure/bed/chair/sofa/update_layer()
// Corner east/west should be on top of mobs, any other state's north should be.
if((corner_piece && ((dir & EAST) || (dir & WEST))) || (!corner_piece && (dir & NORTH)))
if(!corner_piece && (dir & NORTH))
plane = MOB_PLANE
layer = MOB_LAYER + 0.1
else
@@ -318,6 +318,18 @@
base_icon = "sofacorner"
corner_piece = TRUE
/obj/structure/bed/chair/sofa/corner/update_icon()
..()
var/cache_key = "[base_icon]-armrest-[padding_material ? padding_material.name : "no_material"]-permanent"
if(isnull(stool_cache[cache_key]))
var/image/I = image(icon, "[base_icon]_armrest")
I.plane = MOB_PLANE
I.layer = ABOVE_MOB_LAYER
if(padding_material)
I.color = padding_material.icon_colour
stool_cache[cache_key] = I
add_overlay(stool_cache[cache_key])
// Wooden nonsofa - no corners
/obj/structure/bed/chair/sofa/pew
name = "pew bench"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 20 KiB