From 88f32290fcc092a16984117880ce5f033f06fa69 Mon Sep 17 00:00:00 2001 From: Vivalas Date: Mon, 19 Jun 2017 20:45:20 -0500 Subject: [PATCH 1/2] Fixes bed offset --- .../objects/structures/stool_bed_chair_nest/bed.dm | 11 +++++++++++ .../objects/structures/stool_bed_chair_nest/chairs.dm | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/code/game/objects/structures/stool_bed_chair_nest/bed.dm b/code/game/objects/structures/stool_bed_chair_nest/bed.dm index 56c6861e4fc..cb2d80ba5f4 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/bed.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/bed.dm @@ -17,10 +17,20 @@ burntime = 30 buildstackamount = 2 var/movable = 0 // For mobility checks + var/x_offset = 0 + var/y_offset = -6 /obj/structure/stool/bed/MouseDrop(atom/over_object) ..(over_object, skip_fucking_stool_shit = 1) +/obj/structure/stool/bed/post_buckle_mob(mob/living/M) + if(M == buckled_mob) + M.pixel_y = y_offset + M.pixel_x = x_offset + else + M.pixel_y = M.get_standard_pixel_y_offset() + M.pixel_x = M.get_standard_pixel_x_offset() + /obj/structure/stool/psychbed name = "psych bed" desc = "For prime comfort during psychiatric evaluations." @@ -36,6 +46,7 @@ anchored = 0 buildstackamount = 10 buildstacktype = /obj/item/stack/sheet/wood + y_offset = 0 /obj/structure/stool/bed/dogbed/ian name = "Ian's bed" diff --git a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm index 2b8cdd9e3ba..9bc3914b420 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm @@ -5,7 +5,7 @@ buckle_lying = 0 //you sit in a chair, not lay burn_state = FIRE_PROOF buildstackamount = 1 - + y_offset = 0 var/propelled = 0 // Check for fire-extinguisher-driven chairs /obj/structure/stool/bed/chair/New() From 84e3ce1b9a9b922363164befda14d8605034944e Mon Sep 17 00:00:00 2001 From: Vivalas Date: Tue, 20 Jun 2017 17:30:42 -0500 Subject: [PATCH 2/2] Integrates offset better --- code/game/objects/buckling.dm | 1 + .../objects/structures/stool_bed_chair_nest/bed.dm | 13 ++----------- .../structures/stool_bed_chair_nest/chairs.dm | 2 +- code/modules/mob/living/carbon/carbon.dm | 6 ++++-- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/code/game/objects/buckling.dm b/code/game/objects/buckling.dm index 8ff0d7cfcf4..3871517b366 100644 --- a/code/game/objects/buckling.dm +++ b/code/game/objects/buckling.dm @@ -5,6 +5,7 @@ var/buckle_lying = -1 //bed-like behaviour, forces mob.lying = buckle_lying if != -1 //except -1 actually means "rotate 90 degrees to the left" as it is used by 1*buckle_lying. var/buckle_requires_restraints = 0 //require people to be handcuffed before being able to buckle. eg: pipes var/mob/living/buckled_mob = null + var/buckle_offset = 0 //Interaction diff --git a/code/game/objects/structures/stool_bed_chair_nest/bed.dm b/code/game/objects/structures/stool_bed_chair_nest/bed.dm index cb2d80ba5f4..eb3e7d6806e 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/bed.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/bed.dm @@ -17,20 +17,11 @@ burntime = 30 buildstackamount = 2 var/movable = 0 // For mobility checks - var/x_offset = 0 - var/y_offset = -6 + buckle_offset = -6 /obj/structure/stool/bed/MouseDrop(atom/over_object) ..(over_object, skip_fucking_stool_shit = 1) -/obj/structure/stool/bed/post_buckle_mob(mob/living/M) - if(M == buckled_mob) - M.pixel_y = y_offset - M.pixel_x = x_offset - else - M.pixel_y = M.get_standard_pixel_y_offset() - M.pixel_x = M.get_standard_pixel_x_offset() - /obj/structure/stool/psychbed name = "psych bed" desc = "For prime comfort during psychiatric evaluations." @@ -46,7 +37,7 @@ anchored = 0 buildstackamount = 10 buildstacktype = /obj/item/stack/sheet/wood - y_offset = 0 + buckle_offset = 0 /obj/structure/stool/bed/dogbed/ian name = "Ian's bed" diff --git a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm index 9bc3914b420..b76cd70d57b 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm @@ -5,7 +5,7 @@ buckle_lying = 0 //you sit in a chair, not lay burn_state = FIRE_PROOF buildstackamount = 1 - y_offset = 0 + buckle_offset = 0 var/propelled = 0 // Check for fire-extinguisher-driven chairs /obj/structure/stool/bed/chair/New() diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 0848a90e8c0..acc457edb5d 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -881,8 +881,10 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump, /mob/living/carbon/get_standard_pixel_y_offset(lying = 0) if(lying) - if(buckled) return initial(pixel_y) - return -6 + if(buckled) + return buckled.buckle_offset //tg just has this whole block removed, always returning -6. Paradise is special. + else + return -6 else return initial(pixel_y)