ID:158233
 
Okay, I know how to code, but does anyone have the default "get_dir" proc's code? I want to modify it so it is only east/west/north/south.
Just write a new one:

proc/get_cardinal_dir(var/atom/A, var/atom/B)
var/dx = B.x - A.x
var/dy = B.y - A.y
//if they're at the same position
if(dx == 0 && dy == 0)
return 0
if(abs(dx) > abs(dy))
if(dx > 0)
return EAST
else
return WEST
else
if(dy > 0)
return NORTH
else
return SOUTH