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
This commit is contained in:
Migratingcocofruit
2025-04-22 01:34:45 +03:00
committed by GitHub
parent df366b399b
commit d6a1084cfc
2 changed files with 10 additions and 13 deletions
@@ -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