From effd9e299dd5bdc4113032c39bfd0c2c109b8776 Mon Sep 17 00:00:00 2001 From: Aylong <69762909+Aylong220@users.noreply.github.com> Date: Wed, 29 Nov 2023 20:09:50 +0200 Subject: [PATCH] Tweak: Nearby Buckle (Second Try) (#22828) * Tweak: Nearby Buckle * Adjacent * It's definitely better Co-authored-by: Gaxeer <44334376+Gaxeer@users.noreply.github.com> * Small cleanup Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com> --------- Co-authored-by: Gaxeer <44334376+Gaxeer@users.noreply.github.com> Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com> --- code/game/objects/buckling.dm | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/code/game/objects/buckling.dm b/code/game/objects/buckling.dm index 196b9a48b11..88eec417b40 100644 --- a/code/game/objects/buckling.dm +++ b/code/game/objects/buckling.dm @@ -49,7 +49,10 @@ if(!istype(M)) return FALSE - if(check_loc && M.loc != loc) + if(check_loc && !M.Adjacent(src)) + return FALSE + + if(check_loc && M.loc != loc && !M.Move(loc)) return FALSE if((!can_buckle && !force) || M.buckled || (length(buckled_mobs) >= max_buckled_mobs) || (buckle_requires_restraints && !M.restrained()) || M == src) @@ -72,7 +75,7 @@ qdel(G) if(!check_loc && M.loc != loc) - M.forceMove(loc) + M.Move(loc) || M.forceMove(loc) if(!buckle_lying) M.set_body_position(STANDING_UP) @@ -135,9 +138,11 @@ if(!in_range(user, src) || !isturf(user.loc) || user.incapacitated() || M.anchored) return FALSE - if(isguardian(user)) - if(M.loc == user.loc || user.alpha == 60) //Alpha is for detecting ranged guardians in scout mode - return //unmanifested guardians shouldn't be able to buckle mobs + if(isguardian(user) && (M.loc == user.loc || user.alpha == 60)) //Alpha is for detecting ranged guardians in scout mode + return //unmanifested guardians shouldn't be able to buckle mobs + + if(M != user && (!in_range(M, src) || !do_after(user, 1 SECONDS, target = M))) + return FALSE add_fingerprint(user) . = buckle_mob(M, check_loc = check_loc)