ID:272786
 
I was looking at CaptFalcon33035's get_steps() snippet and I got and idea that would utilize such a concept, but would require all the tiles between the ref and the specified dist.

http://www.byond.com/members/jtgibson/forum?id=205

Would it be possible to make a function something like get_steps(), but include all those tiles in between? ;p I was thinking of the block() function, but I wouldn't know how to make it universal to any direction other than making a switch() statement >_>
Nevermind I think the following will work.

mob/proc
get_visual(atom/ref,dir,dist)
if(!ref || !dir || !dist) return
var/list/L = list()
var/turf/current_step = isturf(ref) ? ref : ref.loc
for(var/x=dist,x>0,x--)
if(!current_step) break
L+= current_step
current_step = get_step(current_step,dir)
return L