From d6a1084cfc62feb3f192305358fdc2ffaf1fb354 Mon Sep 17 00:00:00 2001 From: Migratingcocofruit <69551563+Migratingcocofruit@users.noreply.github.com> Date: Tue, 22 Apr 2025 01:34:45 +0300 Subject: [PATCH] Chair rotation fix (#29018) * Makes pushing mobs not revert direction changes from other sources if they happen at the same time * Update chairs.dm * remove signal handler --- .../structures/stool_bed_chair_nest/chairs.dm | 19 +++++++------------ code/modules/mob/living/living.dm | 4 +++- 2 files changed, 10 insertions(+), 13 deletions(-) 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 ae1b2ef290d..9e2bf5ec1ae 100644 --- a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm +++ b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm @@ -22,7 +22,11 @@ /// Used to handle rotation properly, should only be 1, 4, or 8 var/possible_dirs = 4 /// Will it set to the layer above the player or not? Use with Armrests. - var/uses_armrest = FALSE + var/uses_armrest = FALSE + +/obj/structure/chair/setDir(newdir) + . = ..() + handle_rotation() /obj/structure/chair/examine(mob/user) . = ..() @@ -34,10 +38,6 @@ W.setDir(dir) qdel(src) -/obj/structure/chair/Move(atom/newloc, direct = 0, glide_size_override = 0, update_dir = TRUE) - . = ..() - handle_rotation() - /obj/structure/chair/attackby__legacy__attackchain(obj/item/W as obj, mob/user as mob, params) if(istype(W, /obj/item/assembly/shock_kit)) var/obj/item/assembly/shock_kit/SK = W @@ -102,12 +102,12 @@ else rotate() -/obj/structure/chair/proc/handle_rotation(direction) +/obj/structure/chair/proc/handle_rotation() handle_layer() if(has_buckled_mobs()) for(var/m in buckled_mobs) var/mob/living/buckled_mob = m - buckled_mob.setDir(direction) + buckled_mob.setDir(dir) /obj/structure/chair/proc/handle_layer() if(possible_dirs == 8) // We don't want chairs with corner dirs to sit over mobs, it is handled by armrests @@ -126,10 +126,6 @@ . = ..() handle_layer() -/obj/structure/chair/setDir(newdir) - ..() - handle_rotation(newdir) - /obj/structure/chair/AltClick(mob/user) if(user.stat || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED) || !Adjacent(user) || is_ventcrawling(user)) return @@ -144,7 +140,6 @@ /obj/structure/chair/proc/rotate() setDir(turn(dir, (360 / possible_dirs))) - handle_rotation() // Chair types /obj/structure/chair/light diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index f6aaa2ede31..5c58aa20e85 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -212,7 +212,9 @@ stop_pulling() var/current_dir if(isliving(AM)) - current_dir = AM.dir + var/mob/living/living_mob = AM + if(!living_mob.buckled) + current_dir = AM.dir if(AM.Move(get_step(AM.loc, t), t, glide_size)) Move(get_step(loc, t), t) if(current_dir)