Merge pull request #6073 from Heroman3003/conveyor-boogalo

Fixes newly constructed conveyors not working
This commit is contained in:
Neerti
2019-04-14 02:24:06 -04:00
committed by GitHub
+13 -6
View File
@@ -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"