ID:161245
 
DON'T SAY OVIEW! I'm looking for a proc like oview(), but when counting the number of steps away, it doesn't count things diagonally away. So, oview(1) would return everything within one step in any direction, but i'm looking for something that would return everything that's within one step NORTH, SOUTH, EAST, or WEST. Not diagonally. I hope that makes sense, thanks in advance.
make your own then <.<
In response to Falacy
I wanted to know if there was a built in proc, that's all...
In response to Adam753
There's no built-in function of what you want that excludes diagonal directions.
As said before, there's no built-in proc to do this, but you could use something like this to do what you wish:
//This returns all the objects view of the loc, if they
//are in a cardinal direction from it.
proc/cardinal_view(atom/loc, dist=5)
var
//These are to make sure we don't try and grab a
//turf outside the map.
north = (loc.y + dist > world.maxy ? (world.maxy - loc.y) : dist)
south = (loc.y - dist < 1 ? (loc.y - 1) : dist)
east = (loc.x + dist > world.maxx ? (world.maxx - loc.x) : dist)
west = (loc.x - dist < 1 ? (loc.x - 1) : dist)

//This gets the east and west components.
. = block(locate(loc.x - west, loc.y, loc.z), locate(loc.x + east, loc.y, loc.z)) + \
//This gets the north and south components.
block(locate(loc.x, loc.y - south, loc.z), locate(loc.x, loc.y + north, loc.z))

//Because of this loop, this proc won't be as fast as
//the built-in procs. block() only returns turfs, so
//we have to get the other objects from its contents.
var/list/objects[0]
for(var/turf/t in .)
for(var/e in a.contents)
objects += e

. += objects

//This returns all the objects view of the loc, excluding
//the loc (and, if it's a turf, its contents), if they are
//in a cardinal direction from it.
proc/cardinal_oview(atom/loc, dist)
return cardinal_view(loc, dist) - (istype(loc, /turf) ? (loc + loc.contents) : (loc))