a_oview(distance, atom/center=src)
var/list/atoms = list()
var/top = center.y+distance
var/bottom = center.y-distance
var/left = center.x-distance
var/right = center.x+distance
for(var/yy = top, yy >= bottom, yy--)
for(var/xx = left, xx <= right, xx++)
var/ay = ((yy + world.maxy - 1) % world.maxy) + 1
var/ax = ((xx + world.maxx - 1) % world.maxx) + 1
var/turf/T = locate(ax,ay,center.z)
var/atom/A = locate() in T
for(A in T)
if(A != center)
atoms.Add(A)
return atoms
Problem description:
Basically I'm wondering how i could re-organize the list and store them in order by their distance...basically process the closest atom in priority to another one similar that is further away.