ID:2831738
 
Resolved
The built-in pathfinding had some strange behavior directly next to the target, which wasn't apparent until get_steps_to() was added.
BYOND Version:515.1594
Operating System:Windows 10 Home
Web Browser:Chrome 107.0.0.0
Applies to:Dream Daemon
Status: Resolved (515.1595)

This issue has been resolved.
Descriptive Problem Summary:
get_steps_to() is bugged. 100% When using it to pathfind diagonally from 1,1 to 10,10 or 10,1 to 1,10 or anything that's 100% diagonal.

Numbered Steps to Reproduce Problem:
Create a blank project and a turf.dmi file with a blank white tile

Code Snippet (if applicable) to Reproduce Problem:
atom/icon='turf.dmi'

mob/Login()
..()
loc = locate(1,1,1)
color = "#0F0"

turf/Click()
ClearMap()
var list/steps = get_steps_to(usr,src,0)
var turf/turf = usr.loc
for(var/direction in steps)
turf = get_step(turf,direction)
turf.color = "#F00"

turf/icon = 'turf.dmi'


proc/ClearMap()
for(var/turf/t)
t.color = null


Expected Results:
It should color the path 100% of the time.

Actual Results:
Sometimes the returns path is incorrect.
Clicking 3,5 from 1,1


When clicking the tile at 10,10 it doesn't seem to get the correct results.
Seems to only be taking a few steps.



That's a weird one. get_steps_to() is using the exact same pathfinding as ever under the hood. I'll have to look deeper into this.
Lummox JR resolved issue with message:
The built-in pathfinding had some strange behavior directly next to the target, which wasn't apparent until get_steps_to() was added.