File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -114,10 +114,10 @@ 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
- if ( neighbor . h < closestNode . h || ( neighbor . h === closestNode . h && neighbor . g < closestNode . g ) ) {
120
+ if ( neighbor . h < closestNode . h || ( neighbor . h === closestNode . h && neighbor . g < closestNode . g ) ) {
121
121
closestNode = neighbor ;
122
122
}
123
123
}
@@ -136,7 +136,7 @@ var astar = {
136
136
}
137
137
}
138
138
139
- if ( closest ) {
139
+ if ( closest ) {
140
140
return pathTo ( closestNode ) ;
141
141
}
142
142
You can’t perform that action at this time.
0 commit comments