ID:1899476
 
Code:
if(!src.Moving)
if(src.Trail) //var to check if src has a trailing obj
var/lastpos = src.loc //src's last position update
. = ..()
for(var/obj/A in src.TrailList)
step_to(A,lastpos) //Trailing move to src's last position.


Problem description:
This is a pet following feature Im trying to create. How to code an obj that lost sight of you in its oview(1) to go to your location?
You'd need some kind of loop running to keep track of the distance between the owner of the pet and the pet itself, there's not really any need to waste resources on view checking, you can simply keep a variable reference to the pet's own and do a straight distance check. Even that's not entirely needed though, if you do your step_to() inside of said loop, the pet would figure out how to get to you, you could add some kind of decay on it so that you can quick-teleport the pet to the owner if it hasn't managed to find them within [x] amount of time.