Moving while buckled or while in a locker that is locked / welded will no longer reset resist timer. (#26523)

* Moving while buckled to a surface will no longer reset the timer / cause you to fail.

* Properly applies the same principal to closets and secure lockers.

* Changes break out time to use the MINUTES define.

* Apply suggestions from code review

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Signed-off-by: Spaghetti-bit <yumyumkillkill@gmail.com>

---------

Signed-off-by: Spaghetti-bit <yumyumkillkill@gmail.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
This commit is contained in:
Spaghetti-bit
2024-08-24 16:43:47 +00:00
committed by GitHub
co-authored by Burzah
parent 10ab1a87a7
commit 3fd78491e6
3 changed files with 5 additions and 5 deletions
@@ -340,7 +340,7 @@
return TRUE
/obj/structure/closet/container_resist(mob/living/L)
var/breakout_time = 2 //2 minutes by default
var/breakout_time = 2 MINUTES
if(opened)
if(L.loc == src)
L.forceMove(get_turf(src)) // Let's just be safe here
@@ -358,7 +358,7 @@
spawn(0)
if(do_after(L,(breakout_time*60*10), target = src)) //minutes * 60seconds * 10deciseconds
if(do_after(L, breakout_time, target = src, allow_moving = TRUE, allow_moving_target = TRUE))
if(!src || !L || L.stat != CONSCIOUS || L.loc != src || opened) //closet/user destroyed OR user dead/unconcious OR user no longer in closet OR closet opened
return
@@ -98,7 +98,7 @@
add_overlay("unlocked")
/obj/structure/closet/secure_closet/container_resist(mob/living/L)
var/breakout_time = 2 //2 minutes by default
var/breakout_time = 2 MINUTES
if(opened)
if(L.loc == src)
L.forceMove(get_turf(src)) // Let's just be safe here
@@ -113,7 +113,7 @@
spawn(0)
if(do_after(usr,(breakout_time*60*10), target = src)) //minutes * 60seconds * 10deciseconds
if(do_after(usr, breakout_time, target = src, allow_moving = TRUE, allow_moving_target = TRUE))
if(!src || !L || L.stat != CONSCIOUS || L.loc != src || opened) //closet/user destroyed OR user dead/unconcious OR user no longer in closet OR closet opened
return
@@ -830,7 +830,7 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, list(/obj/machinery/atmospherics/unary/ven
visible_message("<span class='warning'>[src] attempts to unbuckle [p_themselves()]!</span>",
"<span class='notice'>You attempt to unbuckle yourself... (This will take around [breakout_time / 10] seconds and you need to stay still.)</span>")
if(!do_after(src, breakout_time, FALSE, src, extra_checks = list(CALLBACK(src, PROC_REF(buckle_check)))))
if(!do_after(src, breakout_time, FALSE, src, allow_moving = TRUE, extra_checks = list(CALLBACK(src, PROC_REF(buckle_check))), allow_moving_target = TRUE))
if(src && buckled)
to_chat(src, "<span class='warning'>You fail to unbuckle yourself!</span>")
else