ID:1587355
 
Code:
mob
step_size = 8
proc
StepToTarget()
walk_to(src, m_pathList[m_nextStepInPath], 0,0,2);
m_nextStepInPath++

turf/floor/Entered(O)
var/mob/m = O
if (m.m_PathFindingTarget)
m.StepToTarget()


Problem description:
Trying to utilize aStar for path finding so when a user clicks on a turf, the mob follows the path. Had this working before pixel movement but now I'm having some trouble. When step_size is 4, the mob walks (slides) as expected but it stops short of the last turf. It stops just outside the turf. How do I get the mob to stop dead center?

Scenario:
- player clicks turf so I call GetAStarPath() and then StepToTarget()
- On each Turf entered along the way, make a call to StepToTarget() (for that mob).
Well you can check if the mob moving towards the target is within a range of 1, using oview(1,src) and if it is, fine-tune the pixels yourself in the StepToTarget() proc, just give it a little bit so it give's a walking visual.
I'm sure there are better ways, but this is what I'll do for the time-being, just to get something going.