ID:160397
 
I really regret posting this, but i've been looking for awhile and can't find it. How would you go about getting an exact direction instead of BYOND's built in crappy get_dir? I think i've seen it before but I can't find it, so either a link or an answer will be nice ^^.
You'll have to clarify "exact direction," and why get_dir() is crappy. I don't seem to recall having problems with get_dir(); get_dist() can be bettered with the Pythagorean Theorem, but that hardly has anything to do with get_dir().
In response to Kuraudo
get_dir() will only return NORTH if the second location is directly above them, if it is say 6 spaces above and one space to the right then it will be NORTHEAST, while in reality is closer to NORTH.

So i'm saying rounding off to the closest direction since BYOND doesnt use 360 of them.
proc/getAngle(atom/source, atom/destination)
var
y = destination.y - source.y
x = destination.x - source.x
r = sqrt(x*x + y*y)
theta = arcsin(y/r)

if(x < 0 && y > 0)
theta = 180 - theta
if(x < 0 && y < 0)
theta = 360 - theta
proc/angle2dir(angle)
switch(angle)
if(22.5 to 67.5)
return NORTHEAST
if(67.5 to 112.5)
return NORTH
... // etc.

Something along those lines is what you would want.

That can probably be done a lot more efficiently. I just spewed out the first thing that came to mind.
hub://Nadrew/rangedetection has a function that does this.