File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ var astar = {
63
63
64
64
start . h = heuristic ( start . pos , end . pos , costStraight , costDiagonal ) ;
65
65
66
- function pathTo ( node ) {
66
+ function pathTo ( node ) {
67
67
var curr = node ;
68
68
var path = [ ] ;
69
69
while ( curr . parent ) {
@@ -83,7 +83,7 @@ var astar = {
83
83
84
84
// End case -- result has been found, return the traced path.
85
85
if ( currentNode === end ) {
86
- return pathTo ( currentNode ) ;
86
+ return pathTo ( currentNode ) ;
87
87
}
88
88
89
89
// Normal case -- move currentNode from open to closed, process each of its neighbors.
@@ -114,7 +114,7 @@ var astar = {
114
114
neighbor . g = gScore ;
115
115
neighbor . f = neighbor . g + neighbor . h ;
116
116
117
- if ( closest ) {
117
+ if ( closest ) {
118
118
// If the neighbour is closer than the current closestNode or if it's equally close but has
119
119
// a cheaper path than the current closest node then it becomes the closest node
120
120
if ( neighbor . h < closestNode . h || ( neighbor . h === closestNode . h && neighbor . g < closestNode . g ) ) {
@@ -238,7 +238,7 @@ Graph.prototype.toString = function() {
238
238
return graphString ;
239
239
} ;
240
240
241
- function GraphNode ( x , y , type ) {
241
+ function GraphNode ( x , y , type ) {
242
242
this . data = { } ;
243
243
this . x = x ;
244
244
this . y = y ;
You can’t perform that action at this time.
0 commit comments