Skip to content
Snippets Groups Projects
Commit 0532cf81 authored by Manuel Herrmann's avatar Manuel Herrmann
Browse files

pathfinder fix

parent 56bd9f55
No related branches found
No related tags found
No related merge requests found
......@@ -99,7 +99,10 @@ PathFinder.prototype.findPath = function(fromX, fromY, toX, toY) {
toScan.queue({x:aX, y:aY, score:1});
function scan(laX, laY, lzX, lzY, lScore) {
var r = self.raster[lzY][lzX];
var l = self.raster[lzY];
if (!l) return;
var r = l[lzX];
if (!r) return;
if (r.walkable && (r.score == -1 || lScore < r.score)) {
r.from = [laX+0, laY+0];
r.score = lScore+0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment