ID:175168
 
In my game I have a train that goes on tracks and I dont want it to cut corners...How can I disable diagonals for this mob?
Koolguy900095 wrote:
In my game I have a train that goes on tracks and I dont want it to cut corners...How can I disable diagonals for this mob?

Well, since you're on tracks this shouldn't be a problem; you can tell the engine to move ahead if there's track ahead, or look to the sides otherwise.
mob/train
var/mob/train/next // next car

proc/Go()
for(var/angle in list(0, 90, -90))
var/turf/T = get_step(src, turn(dir, angle))
if(T && locate(/obj/track) in T)
dir = turn(dir, angle)
if(Move(T) && next) next.Go()
return

Lummox JR