transit pods should reverse direction when they reach the end of the tube

Signed-off-by: Cael_Aislinn <cael_aislinn@yahoo.com.au>
This commit is contained in:
Cael_Aislinn
2013-05-14 13:10:28 +10:00
parent 23affb99bf
commit 749d3eeaa0
@@ -150,6 +150,17 @@ obj/structure/ex_act(severity)
pod_moving = 1
close_animation()
sleep(CLOSE_DURATION + 2)
//reverse directions for automated cycling
var/turf/next_loc = get_step(loc, pod.dir)
var/obj/structure/transit_tube/nexttube
for(var/obj/structure/transit_tube/tube in next_loc)
if(tube.has_entrance(pod.dir))
nexttube = tube
break
if(!nexttube)
pod.dir = turn(pod.dir, 180)
if(icon_state == "closed" && pod)
pod.follow_tube()