From b666e5977c4ecddfce607b0cd8b1fe03ded42a83 Mon Sep 17 00:00:00 2001 From: CitadelStationBot Date: Tue, 13 Jun 2017 02:34:27 -0500 Subject: [PATCH] Fixes gang turrets buckle code (atleast most of it) --- code/game/objects/buckling.dm | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/code/game/objects/buckling.dm b/code/game/objects/buckling.dm index 78aa6d49e8..0034a7e6df 100644 --- a/code/game/objects/buckling.dm +++ b/code/game/objects/buckling.dm @@ -43,19 +43,19 @@ buckled_mobs = list() if(!istype(M)) - return 0 + return FALSE if(check_loc && M.loc != loc) - return 0 + return FALSE if((!can_buckle && !force) || M.buckled || (buckled_mobs.len >= max_buckled_mobs) || (buckle_requires_restraints && !M.restrained()) || M == src) - return 0 + return FALSE if(!M.can_buckle() && !force) if(M == usr) to_chat(M, "You are unable to buckle yourself to the [src]!") else to_chat(usr, "You are unable to buckle [M] to the [src]!") - return 0 + return FALSE if(M.pulledby && buckle_prevents_pull) M.pulledby.stop_pulling() @@ -70,7 +70,7 @@ M.throw_alert("buckled", /obj/screen/alert/restrained/buckled, new_master = src) post_buckle_mob(M) - return 1 + return TRUE /obj/buckle_mob(mob/living/M, force = FALSE, check_loc = TRUE) . = ..() @@ -105,11 +105,11 @@ //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) || user.stat || user.restrained()) - return 0 + return FALSE add_fingerprint(user) - - if(buckle_mob(M, check_loc = check_loc)) + . = buckle_mob(M, check_loc = check_loc) + if(.) if(M == user) M.visible_message(\ "[M] buckles [M.p_them()]self to [src].",\ @@ -120,8 +120,6 @@ "[user] buckles [M] to [src]!",\ "[user] buckles you to [src]!",\ "You hear metal clanking.") - return 1 - /atom/movable/proc/user_unbuckle_mob(mob/living/buckled_mob, mob/user) var/mob/living/M = unbuckle_mob(buckled_mob)