From 13b776b51cf561827cc9f535523225b3f7a50bd0 Mon Sep 17 00:00:00 2001 From: Citinited Date: Wed, 7 Nov 2018 18:20:05 +0000 Subject: [PATCH] Adds timer to conveyors; checks speed_process before trying to change to / from speed process --- code/modules/recycling/conveyor2.dm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/code/modules/recycling/conveyor2.dm b/code/modules/recycling/conveyor2.dm index 95234c850d5..e5ca5fb0d28 100644 --- a/code/modules/recycling/conveyor2.dm +++ b/code/modules/recycling/conveyor2.dm @@ -170,19 +170,22 @@ GLOBAL_LIST_INIT(conveyor_switches, list()) if(AM.anchored) continue still_stuff_to_move = TRUE - sleep(1) - if(AM.loc == loc) // prevents the object from being affected if it's not currently here. - step(AM,forwards) + addtimer(CALLBACK(src, .proc/move_thing, AM), 1) CHECK_TICK - if(!still_stuff_to_move) + if(!still_stuff_to_move && speed_process) makeNormalProcess() - else + else if(still_stuff_to_move && !speed_process) makeSpeedProcess() /obj/machinery/conveyor/Crossed(atom/movable/AM) - makeSpeedProcess() + if(!speed_process) + makeSpeedProcess() ..() +/obj/machinery/conveyor/proc/move_thing(atom/movable/AM) + if(!AM.anchored && AM.loc == loc) + step(AM, forwards) + /obj/machinery/conveyor/proc/can_conveyor_run() if(stat & BROKEN) return FALSE