ID:1897585
 
Not a bug
BYOND Version:508
Operating System:Windows 7 Home Premium 64-bit
Web Browser:Chrome 45.0.2454.6
Applies to:DM Language
Status: Not a bug

This is not a bug. It may be an incorrect use of syntax or a limitation in the software. For further discussion on the matter, please consult the BYOND forums.
Not entirely sure if bug report, or feature request.

get_dir() does not seem to be able to return the constants UP or DOWN. This is inconsistent with the other get_*, step and walk functions being able to accept UP or DOWN as argument dir.

world
maxx = 10
maxy = 10
maxz = 3

mob/Login()
loc = locate(5,5,2)
var/mob/mob1 = new(locate(5,5,1))
var/mob/mob2 = new(locate(5,5,3))

world << get_dir(src, mob1)
world << get_dir(src, mob2)

var/turf/uploc = get_step(src, UP)
world << "[uploc.x], [uploc.y], [uploc.z]"

var/turf/downloc = get_step(src, DOWN)
world << "[downloc.x], [downloc.y], [downloc.z]"

world << "before step: [x], [y], [z]"
step(src, UP|EAST)
world << "after step: [x], [y], [z]"
Yeah I was having this issue as well, thought it was just me.
Those procs accept UP or DOWN as an argument dir, but don't return it. That is, a user can make use of these constants if they want to send it to those procs, but since UP and DOWN are meaningless in most games, most users wouldn't want get_dir() to return them. Therefore I don't really consider this inconsistent, nor a bug.

get_dir() has always only worked on the same Z level. Changing it would probably mess up a number of games.
Lummox JR resolved issue (Not a bug)
Would it be possible to implement a third argument, to indicate if Z-levels should be used in determining the return value?
proc/get_dir_adv(atom/a,atom/b)
if(a.z==b.z)
return get_dir(a,b)
else if(a.z&&b.z)
if(a.z>b.z)
. = DOWN
else
. = UP
. += get_dir(locate(a.x,a.y,b.z),b)
else
return 0