Closed cmal closed 8 years ago
I've found the problem: the passableCallback(fromX, fromY) should return true.
did you mean y < 0 after the second ||?
Yeah, this is definitely a bug! Thanks for spotting it.
I've found the problem: the passableCallback(fromX, fromY) should return true.
Can you please be more specific? Where and what should I fix? :)
No. It is my fault. I'm using rot.js
the first time. Because I didn't know the passableCallback(fromX, fromY)
should return true (or the start and end should be passable to compute the path), so dijkstra.compute
did not work correctly. Thanks for the excellet rot.js
.
I see. I will fix the duplicate x<0
issue soon. Stay tuned :)
Fixed, thanks :)
I've been debugging my code and traced that the
dijkstra.compute
never go into my callback functions, then I foundthis._computed
never include the keyfromX+","+fromY
, then I found the _getNeighbors function didn't return thefromX+","+fromY
key. I go into the _getNeighbors function, and found the following code ,if (x < 0 || x >= this._width || x < 0 || y >= this._width) { continue; }
, did you meany < 0
after the second||
? I've not finished my debugging, I don't think this is the problem. Because in theinteractive manual
thefromX+","+fromY
does show in the path finding computation. I'm still working with the problem, and hope further helps from you. Thank you for your excellent work!