ID:1282214
 
(See the best response by Kaiochao.)
proc
_walk_to(atom/movable/ref, atom/trg, min=0, lag=0, speed = 0)
var atom/abs_trg = trg
if(!isturf(trg)) abs_trg = trg.loc

if(!speed) speed = ref.step_size

var last_dir = get_dir(ref,abs_trg)

while((ref.x != abs_trg.x) || (ref.y != abs_trg.y))
var d = get_dir(ref, abs_trg)
if((d != last_dir) && (d != 0))
last_dir = d
step(ref, last_dir, speed)
sleep(lag ? lag : world.tick_lag)


My issue is that the default walk_to() (And procs like it, such as step_to) become retarded when you use pixel movement.
Once you start using pixel movement, walk_to() will only take you until you partially cross over a tile. The bare minimum.
I want it to go until I fill that tile. I got it somewhat working using a method with get_dir() (Which I had to work around as well, because once you partially cross over a tile, get_dir() returns 0), but it doesn't account for obstacles.

Its late and I'm tired and I'd like some help fleshing this out because I don't want to bloat things up just for something that would seemingly be simple.

I know there's some things that don't need to be here (Like the abs_trg variable - I don't need that), but that was just clunkiness caused by me trying various different things.
Bump.
Best response
It would be cheaper to use walk_to() when going towards the target then have your proc kick in and center the atom once it's close enough for walk_to() to stop.