prettymuchbryce / easystarjs

An asynchronous A* pathfinding API written in Javascript.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

findPath returns a number

EyesightTechnology opened this issue · comments

Hello, I have this code

`function checkPath() {
console.log(typeof path)
if(path[1] === undefined) console.log("Null")
else {
console.log("Exists")
powerValue = 1;
}
}

path = electrical_pathfind.findPath(coordX, coordY, powerSourceIndex[0][0], powerSourceIndex[0][1], checkPath);
electrical_pathfind.calculate();`

Notice the typeof path line. This reads "Number." Sure enough, when I log "path," an integer value is logged - NOT an array.

What causes findPath to return a number rather then... well... a path? I have another completely separate pathfind system elsewhere in my code that works flawlessly - it returns an actual path!

Hello there. Thanks for opening an issue. You might be interested in reading the documentation. I think it should answer your question.

Hello there. Thanks for opening an issue. You might be interested in reading the documentation. I think it should answer your question.

I've read the documentation, and the issue clearly isn't addressed. Please point me to where I can find a solution to this issue.