proc
a_get_dir(atom/A=src, atom/B)
var/dir = get_dir(A,B)
if(dir & NORTH)
if(abs(B.y-A.y) > world.maxy*0.5)
return 2
else
return 1
if(dir & SOUTH)
if(abs(B.y-A.y) < world.maxy*0.5)
return 2
else
return 1
if(dir & EAST)
if(abs(B.x-A.x) > world.maxx*0.5)
return 8
else
return 4
if(dir & WEST)
if(abs(B.x-A.x) < world.maxx*0.5)
return 8
else
return 4
although now i need to check for northwest,northeast,southeast,southwest
which im not sure how i would compare?
I'll give you another hint for get_dir_wrap(). If the distance from A to B along an axis (x or y) is greater than half the length of the map (along that axis), then it would be "faster" to wrap around the map than walk normally from A to B. So if you determine that normally get_dir() would return NORTH, but abs(B.y-A.y) is > world.maxy*0.5, you would send them SOUTH. Just remember to determine each axis separately, and then combine them at the end, and I think you'll be able to get it.