use fox's code

This commit is contained in:
Couls
2019-08-29 20:41:12 -04:00
parent 8715878a67
commit b1dd4d5496
@@ -15,18 +15,20 @@
var/move_delay = 0
var/egged = 0
/obj/structure/closet/cardboard/relaymove(mob/user, direction)
if(opened || move_delay || user.stat || user.stunned || user.weakened || user.paralysis || !isturf(loc) || !has_gravity(loc))
/obj/structure/closet/cardboard/relaymove(mob/living/user, direction)
if(!istype(user) || opened || move_delay || user.incapacitated() || !isturf(loc) || !has_gravity(loc))
return
move_delay = TRUE
var/oldloc = loc
step(src, direction)
if(oldloc != loc)
spawn(config.walk_speed)
move_delay = FALSE
addtimer(CALLBACK(src, .proc/ResetMoveDelay), config.walk_speed)
else
move_delay = FALSE
/obj/structure/closet/cardboard/proc/ResetMoveDelay()
move_delay = FALSE
/obj/structure/closet/cardboard/open()
if(opened || !can_open())
return 0