From b9729ca0e13308d575ea8cee39978bbbaecfe428 Mon Sep 17 00:00:00 2001
From: SkyratBot <59378654+SkyratBot@users.noreply.github.com>
Date: Wed, 2 Sep 2020 02:50:24 +0200
Subject: [PATCH] [MIRROR] You can buckle yourself or somebody else into a
chair, if you're next to the chair. (#593)
* You can buckle yourself or somebody else into a chair, if you're next to the chair. (#53255)
You can now buckle yourself, as well as others, into a chair as long as you (and the other person, if you're not buckling yourself) are Adjacent to said chair, and being on the same tile as the chair is no longer required.
No more god-awful pixelhunt to accomplish a very simple task.
(You can buckle yourself and others into chairs that you're right next to, instead of needing to be on top of the chair to do it.)
* You can buckle yourself or somebody else into a chair, if you're next to the chair.
Co-authored-by: uomo <51800976+uomo91@users.noreply.github.com>
---
code/game/objects/buckling.dm | 11 ++++++++---
code/game/objects/structures/beds_chairs/chair.dm | 3 +++
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/code/game/objects/buckling.dm b/code/game/objects/buckling.dm
index 82564664fd4..40a8b9bb066 100644
--- a/code/game/objects/buckling.dm
+++ b/code/game/objects/buckling.dm
@@ -140,10 +140,16 @@
//Wrapper procs that handle sanity and user feedback
/atom/movable/proc/user_buckle_mob(mob/living/M, mob/user, check_loc = TRUE)
- if(!in_range(user, src) || !isturf(user.loc) || user.incapacitated() || M.anchored)
+ if(!Adjacent(user) || !Adjacent(M) || !isturf(user.loc) || user.incapacitated() || M.anchored)
return FALSE
add_fingerprint(user)
+ if (M != user)
+ M.visible_message("[user] starts buckling [M] to [src]!",\
+ "[user] starts buckling you to [src]!",\
+ "You hear metal clanking.")
+ if(!do_after(user, 3 SECONDS, TRUE, M))
+ return FALSE
. = buckle_mob(M, check_loc = check_loc)
if(.)
if(M == user)
@@ -152,8 +158,7 @@
"You hear metal clanking.")
else
M.visible_message("[user] buckles [M] to [src]!",\
- "[user] buckles you to [src]!",\
- "You hear metal clanking.")
+ "[user] buckles you to [src]!")
/atom/movable/proc/user_unbuckle_mob(mob/living/buckled_mob, mob/user)
var/mob/living/M = unbuckle_mob(buckled_mob)
diff --git a/code/game/objects/structures/beds_chairs/chair.dm b/code/game/objects/structures/beds_chairs/chair.dm
index d9d9c44915c..827a1d2901c 100644
--- a/code/game/objects/structures/beds_chairs/chair.dm
+++ b/code/game/objects/structures/beds_chairs/chair.dm
@@ -249,6 +249,9 @@
usr.put_in_hands(C)
qdel(src)
+/obj/structure/chair/user_buckle_mob(mob/living/M, force, check_loc = FALSE)
+ return ..()
+
/obj/structure/chair/stool/bar
name = "bar stool"
desc = "It has some unsavory stains on it..."