diff --git a/code/game/machinery/OpTable.dm b/code/game/machinery/OpTable.dm
index bef2d4d495d..00c7320ccf9 100644
--- a/code/game/machinery/OpTable.dm
+++ b/code/game/machinery/OpTable.dm
@@ -128,8 +128,7 @@
if(istype(M))
var/mob/living/L = target
var/bucklestatus = L.bucklecheck(user)
-
- if(!bucklestatus)//We must make sure the person is unbuckled before they go in
+ if(!bucklestatus)
return
if(L == user)
@@ -163,8 +162,7 @@
var/mob/living/L = G.affecting
var/bucklestatus = L.bucklecheck(user)
-
- if(!bucklestatus)//We must make sure the person is unbuckled before they go in
+ if(!bucklestatus)
return TRUE
if(L == user)
@@ -172,9 +170,6 @@
else
user.visible_message(SPAN_NOTICE("\The [user] starts putting \the [L] onto \the [src]."), SPAN_NOTICE("You start putting \the [L] onto \the [src]."), range = 3)
if(do_mob(user, L, 10, needhand = FALSE))
- if(bucklestatus == 2)
- var/obj/structure/LB = L.buckled_to
- LB.user_unbuckle(user)
take_victim(G.affecting,usr)
qdel(W)
return TRUE
diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm
index 58fa58ac42b..0267f599882 100644
--- a/code/game/machinery/Sleeper.dm
+++ b/code/game/machinery/Sleeper.dm
@@ -233,6 +233,9 @@
var/obj/item/grab/G = I
var/mob/living/L = G.affecting
+ var/bucklestatus = L.bucklecheck(user)
+ if(!bucklestatus)
+ return TRUE
if(!istype(L))
to_chat(user, "\The machine won't accept that.")
@@ -245,10 +248,6 @@
if(occupant)
to_chat(user, "\The [src] is already occupied.")
return TRUE
- var/bucklestatus = L.bucklecheck(user)
-
- if (!bucklestatus)//incase the patient got buckled_to during the delay
- return TRUE
if(L != G.affecting)//incase it isn't the same mob we started with
return TRUE
@@ -272,6 +271,14 @@
/obj/machinery/sleeper/MouseDrop_T(var/mob/target, var/mob/user)
if(user.stat || user.lying || !Adjacent(user) || !target.Adjacent(user)|| !ishuman(target))
return
+
+ var/mob/living/L = target
+ var/bucklestatus = L.bucklecheck(user)
+ if(!bucklestatus)
+ return
+ if(bucklestatus == 2)
+ var/obj/structure/LB = L.buckled_to
+ LB.user_unbuckle(user)
go_in(target, user)
/obj/machinery/sleeper/relaymove(var/mob/user)
diff --git a/code/game/machinery/body_scanner.dm b/code/game/machinery/body_scanner.dm
index 8b0d940c1e5..55a0c440f80 100644
--- a/code/game/machinery/body_scanner.dm
+++ b/code/game/machinery/body_scanner.dm
@@ -129,15 +129,12 @@
return TRUE
var/mob/living/M = G.affecting
- user.visible_message(SPAN_NOTICE("\The [user] starts putting \the [M] into \the [src]."), SPAN_NOTICE("You start putting \the [M] into \the [src]."), range = 3)
+ var/bucklestatus = M.bucklecheck(user)
+ if (!bucklestatus)
+ return TRUE
+ user.visible_message(SPAN_NOTICE("\The [user] starts putting \the [M] into \the [src]."), SPAN_NOTICE("You start putting \the [M] into \the [src]."), range = 3)
if (do_mob(user, G.affecting, 30, needhand = 0))
- var/bucklestatus = M.bucklecheck(user)
- if (!bucklestatus)//incase the patient got buckled_to during the delay
- return TRUE
- if (bucklestatus == 2)
- var/obj/structure/LB = M.buckled_to
- LB.user_unbuckle(user)
if (M.client)
M.client.perspective = EYE_PERSPECTIVE
M.client.eye = src
@@ -167,8 +164,7 @@
var/mob/living/L = O
var/bucklestatus = L.bucklecheck(user)
-
- if (!bucklestatus)//We must make sure the person is unbuckled before they go in
+ if (!bucklestatus)
return
if(L == user)
diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm
index 19e0d0bd575..44d4fdd0c38 100644
--- a/code/game/machinery/cryo.dm
+++ b/code/game/machinery/cryo.dm
@@ -194,15 +194,12 @@
if (!istype(L))
return
- user.visible_message("[user] starts putting [L] into [src].", "You start putting [L] into [src].", range = 3)
+ var/bucklestatus = L.bucklecheck(user)
+ if(!bucklestatus)
+ return TRUE
+ user.visible_message("[user] starts putting [L] into [src].", "You start putting [L] into [src].", range = 3)
if(do_mob(user, L, 30, needhand = 0))
- var/bucklestatus = L.bucklecheck(user)
- if(!bucklestatus)//incase the patient got buckled_to during the delay
- return TRUE
- if(bucklestatus == 2)
- var/obj/structure/LB = L.buckled_to
- LB.user_unbuckle(user)
for(var/mob/living/carbon/slime/M in range(1, L))
if(M.victim == L)
to_chat(user, SPAN_WARNING("[L] will not fit into the cryo because they have a slime latched onto their head."))
@@ -224,8 +221,7 @@
return
var/bucklestatus = L.bucklecheck(user)
-
- if (!bucklestatus)//We must make sure the person is unbuckled before they go in
+ if (!bucklestatus)
return
if(L == user)
diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm
index e63c1993f87..577e474c653 100644
--- a/code/game/machinery/cryopod.dm
+++ b/code/game/machinery/cryopod.dm
@@ -391,7 +391,10 @@ var/global/list/frozen_crew = list()
return TRUE
var/willing = FALSE //We don't want to allow people to be forced into despawning.
- var/mob/M = G.affecting
+ var/mob/living/M = G.affecting
+ var/bucklestatus = M.bucklecheck(user)
+ if(!bucklestatus)
+ return TRUE
if(M.client)
var/original_loc = M.loc
@@ -442,8 +445,8 @@ var/global/list/frozen_crew = list()
return
var/mob/living/L = O
-
- if(!L.bucklecheck(user)) //We must make sure the person is unbuckled before they go in
+ var/bucklestatus = L.bucklecheck(user)
+ if(!bucklestatus) //We must make sure the person is unbuckled before they go in
return
if(L.stat == DEAD)
diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm
index 544e0fa0bcb..b5f78e4c5e3 100644
--- a/code/game/machinery/iv_drip.dm
+++ b/code/game/machinery/iv_drip.dm
@@ -84,6 +84,10 @@
if(breath_mask)
if(prob(60))
if(breather)
+ var/bucklestatus = breather.bucklecheck(M)
+ if(!bucklestatus)
+ var/obj/structure/LB = M.buckled_to
+ LB.user_unbuckle(breather)
src.visible_message(
SPAN_WARNING("[M] trips on \the [src]'s [breath_mask] cable, pulling \the [breather] down as well!"),
SPAN_WARNING("You trip on \the [src]'s [breath_mask] cable, pulling \the [breather] down as well!"))
@@ -186,11 +190,6 @@
/obj/machinery/iv_drip/proc/breather_process()
if(breather)
- if(!tank)
- return
- if(breather.species.flags & NO_BREATHE)
- return
-
if(!breather.Adjacent(src))
step_to(src, get_turf(breather), 1)
if(world.time > last_creak + 10 SECONDS)
@@ -204,6 +203,11 @@
if(prob(40))
do_crash()
+ if(!tank)
+ return
+ if(breather.species.flags & NO_BREATHE)
+ return
+
if(valve_open)
var/obj/item/organ/internal/lungs/L = breather.internal_organs_by_name[BP_LUNGS]
if(!L)
@@ -251,6 +255,11 @@
/obj/machinery/iv_drip/proc/attached_process()
if(attached)
+ if(!attached.Adjacent(src))
+ iv_rip()
+ update_icon()
+ return
+
if(!beaker)
return
if(!attached.dna)
@@ -260,11 +269,6 @@
if(attached.species.flags & NO_BLOOD)
return
- if(!attached.Adjacent(src))
- iv_rip()
- update_icon()
- return
-
if(mode) // Injecting
if(beaker.reagents.total_volume > 0)
beaker.reagents.trans_to_mob(attached, transfer_amount, CHEM_BLOOD)
@@ -549,6 +553,11 @@
breath_mask.SpinAnimation(4, 2)
breath_mask = null
else
+ var/mob/living/L = breather
+ var/bucklestatus = L.bucklecheck(L)
+ if(!bucklestatus)
+ var/obj/structure/LB = L.buckled_to
+ LB.user_unbuckle(breather)
src.visible_message(SPAN_WARNING("\The [breath_mask] pulls \the [breather] down with \the [src]!"), SPAN_WARNING("\The [breath_mask] pulls you down with \the [src]!"))
breather.forceMove(dropspot)
breather.Weaken(4)
diff --git a/code/game/machinery/rechargestation.dm b/code/game/machinery/rechargestation.dm
index 53b5fc85b98..621cf5752a9 100644
--- a/code/game/machinery/rechargestation.dm
+++ b/code/game/machinery/rechargestation.dm
@@ -160,6 +160,10 @@
if(!L.isSynthetic())
return TRUE
+ var/bucklestatus = L.bucklecheck(user)
+ if(!bucklestatus)
+ return TRUE
+
move_ipc(grab.affecting)
qdel(O)
return ..()
@@ -328,7 +332,6 @@
if(bucklestatus == 2)
var/obj/structure/LB = R.buckled_to
LB.user_unbuckle(user)
- return
user.face_atom(src)
move_ipc(R)
diff --git a/code/game/objects/structures/therapy.dm b/code/game/objects/structures/therapy.dm
index 5b890f98596..acb370cf61d 100644
--- a/code/game/objects/structures/therapy.dm
+++ b/code/game/objects/structures/therapy.dm
@@ -337,18 +337,13 @@
to_chat(user, "The pod is locked.")
return
-
var/mob/living/L = G.affecting
+ var/bucklestatus = L.bucklecheck(user)
+ if (!bucklestatus)
+ return
+
user.visible_message("[user] starts putting [L] into [src].", "You start putting [L] into [src].", range = 3)
-
if (do_mob(user, L, 30, needhand = 0))
- var/bucklestatus = L.bucklecheck(user)
- if (!bucklestatus)//incase the patient got buckled_to during the delay
- return
- if (bucklestatus == 2)
- var/obj/structure/LB = L.buckled_to
- LB.user_unbuckle(user)
-
if (L.client)
L.client.perspective = EYE_PERSPECTIVE
L.client.eye = src
@@ -377,8 +372,7 @@
return
var/bucklestatus = H.bucklecheck(user)
-
- if (!bucklestatus)//We must make sure the person is unbuckled before they go in
+ if (!bucklestatus)
return
if(H == user)
diff --git a/html/changelogs/sleeper_buckledrollers.yml b/html/changelogs/sleeper_buckledrollers.yml
new file mode 100644
index 00000000000..5787c587041
--- /dev/null
+++ b/html/changelogs/sleeper_buckledrollers.yml
@@ -0,0 +1,7 @@
+author: Vrow
+
+delete-after: True
+
+changes:
+ - bugfix: "Fixed some buckle checks not doing their thing properly in machines like Recharger Stations, Sleepers, Cryo Cells, etc."
+ - bugfix: "Fixed IV stand not crashing/ripping if the attached patient has a mask/IV, but not a tank/beaker installed in the stand itself."
\ No newline at end of file