Fixes newly constructed conveyors not working

This commit is contained in:
Heroman
2019-04-13 06:05:53 +10:00
parent e968925caa
commit af20e0e349
+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"