From 93e6bbc03145a24aafeffe28ab8521ab606edde9 Mon Sep 17 00:00:00 2001 From: Neerti Date: Sun, 14 Apr 2019 02:24:06 -0400 Subject: [PATCH 1/2] Merge pull request #6073 from Heroman3003/conveyor-boogalo Fixes newly constructed conveyors not working --- code/modules/recycling/conveyor2.dm | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/code/modules/recycling/conveyor2.dm b/code/modules/recycling/conveyor2.dm index 4121b8a5582..4cc755d1580 100644 --- a/code/modules/recycling/conveyor2.dm +++ b/code/modules/recycling/conveyor2.dm @@ -32,12 +32,7 @@ if(newdir) set_dir(newdir) - if(dir & (dir-1)) // Diagonal. Forwards is *away* from dir, curving to the right. - forwards = turn(dir, 135) - backwards = turn(dir, 45) - else - forwards = dir - backwards = turn(dir, 180) + update_dir() if(on) operating = FORWARDS @@ -60,6 +55,18 @@ operating = OFF update() +/obj/machinery/conveyor/set_dir() + .=..() + update_dir() + +/obj/machinery/conveyor/proc/update_dir() + if(!(dir in cardinal)) // Diagonal. Forwards is *away* from dir, curving to the right. + forwards = turn(dir, 135) + backwards = turn(dir, 45) + else + forwards = dir + backwards = turn(dir, 180) + /obj/machinery/conveyor/proc/update() if(stat & BROKEN) icon_state = "conveyor-broken"