diff --git a/code/game/objects/structures/beds_chairs/chair.dm b/code/game/objects/structures/beds_chairs/chair.dm index 7814c5f9c4..cec97d5d8b 100644 --- a/code/game/objects/structures/beds_chairs/chair.dm +++ b/code/game/objects/structures/beds_chairs/chair.dm @@ -102,8 +102,7 @@ buckled_mob.setDir(direction) /obj/structure/chair/proc/handle_layer() - . = has_buckled_mobs() - if(. && dir == NORTH) + if(has_buckled_mobs() && dir == NORTH) layer = ABOVE_MOB_LAYER else layer = OBJ_LAYER @@ -502,12 +501,19 @@ armrest = mutable_appearance(icon, "[icon_state]_armrest") return ..() -/obj/structure/chair/sofa/handle_layer() +/obj/structure/chair/sofa/post_buckle_mob(mob/living/M) . = ..() - if(.) - armrest.layer = ABOVE_MOB_LAYER + update_armrest() + +/obj/structure/chair/sofa/proc/update_armrest() + if(has_buckled_mobs()) + add_overlay(armrest) else - armrest.layer = OBJ_LAYER + cut_overlay(armrest) + +/obj/structure/chair/sofa/post_unbuckle_mob() + . = ..() + update_armrest() /obj/structure/chair/sofa/left icon_state = "sofaend_left" @@ -516,4 +522,7 @@ icon_state = "sofaend_right" /obj/structure/chair/sofa/corner - icon_state = "sofacorner" \ No newline at end of file + icon_state = "sofacorner" + +/obj/structure/chair/sofa/corner/handle_layer() //only the armrest/back of this chair should cover the mob. + return \ No newline at end of file