Skip to content

Commit

Permalink
Tweak: Nearby Buckle (Second Try) (ParadiseSS13#22828)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
3 people authored and Oyu07 committed Jan 1, 2024
1 parent 086e550 commit f6d0db3
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions code/game/objects/buckling.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand 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)
Expand Down

0 comments on commit f6d0db3

Please sign in to comment.