Merge pull request #1851 from Yoshax/bugfixes

Adjusts the checks to ensure you cannot buckle two people to the same thing
This commit is contained in:
Neerti
2016-06-02 10:36:25 -04:00
2 changed files with 2 additions and 5 deletions

View File

@@ -5,7 +5,6 @@
var/buckle_lying = -1 //bed-like behavior, forces mob.lying = buckle_lying if != -1
var/buckle_require_restraints = 0 //require people to be handcuffed before being able to buckle. eg: pipes
var/mob/living/buckled_mob = null
var/has_buckled
/obj/attack_hand(mob/living/user)
. = ..()
@@ -30,7 +29,7 @@
/obj/proc/buckle_mob(mob/living/M)
if(!can_buckle || !istype(M) || (M.loc != loc) || M.buckled || M.pinned.len || (buckle_require_restraints && !M.restrained()))
return 0
if(has_buckled) //Handles trying to buckle yourself to the chair when someone is on it
if(buckled_mob) //Handles trying to buckle yourself to the chair when someone is on it
M << "<span class='notice'>\The [src] already has someone buckled to it.</span>"
return 0
@@ -39,7 +38,6 @@
M.set_dir(buckle_dir ? buckle_dir : dir)
M.update_canmove()
buckled_mob = M
has_buckled = 1
post_buckle_mob(M)
return 1
@@ -51,7 +49,6 @@
buckled_mob.anchored = initial(buckled_mob.anchored)
buckled_mob.update_canmove()
buckled_mob = null
has_buckled = 0
post_buckle_mob(.)

View File

@@ -129,7 +129,7 @@
else if(istype(W, /obj/item/weapon/grab))
var/obj/item/weapon/grab/G = W
var/mob/living/affecting = G.affecting
if(has_buckled) //Handles trying to buckle someone else to a chair when someone else is on it
if(buckled_mob) //Handles trying to buckle someone else to a chair when someone else is on it
user << "<span class='notice'>\The [src] already has someone buckled to it.</span>"
return
user.visible_message("<span class='notice'>[user] attempts to buckle [affecting] into \the [src]!</span>")