Skip to content

Commit

Permalink
Remove endNode evaluation forcing
Browse files Browse the repository at this point in the history
  • Loading branch information
Yonaba committed Apr 9, 2013
1 parent 590553b commit 497129e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion jumper/search/astar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if (...) then
if neighbour._g < oldG then
local nClearance = neighbour._clearance[finder._walkable] or finder._grid:evalClearance(neighbour, finder._walkable)
local pushThisNode = clearance and nClearance and (nClearance >= clearance)
if (clearance and pushThisNode) or (not clearance) or (neighbour == endNode) then
if (clearance and pushThisNode) or (not clearance) then
if neighbour._opened then neighbour._opened = false end
neighbour._h = heuristic(endNode, neighbour)
neighbour._f = neighbour._g + neighbour._h
Expand Down
2 changes: 1 addition & 1 deletion jumper/search/bfs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if (...) then
if not neighbour._closed and not neighbour._opened then
local nClearance = neighbour._clearance[finder._walkable] or finder._grid:evalClearance(neighbour, finder._walkable)
local pushThisNode = clearance and nClearance and (nClearance >= clearance)
if (clearance and pushThisNode) or (not clearance) or (neighbour == endNode) then
if (clearance and pushThisNode) or (not clearance) then
openList[#openList+1] = neighbour
neighbour._opened = true
neighbour._parent = node
Expand Down
2 changes: 1 addition & 1 deletion jumper/search/dfs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if (...) then
if (not neighbour._closed and not neighbour._opened) then
local nClearance = neighbour._clearance[finder._walkable] or finder._grid:evalClearance(neighbour, finder._walkable)
local pushThisNode = clearance and nClearance and (nClearance >= clearance)
if (clearance and pushThisNode) or (not clearance) or (neighbour == endNode) then
if (clearance and pushThisNode) or (not clearance) then
openList[#openList+1] = neighbour
neighbour._opened = true
neighbour._parent = node
Expand Down

0 comments on commit 497129e

Please sign in to comment.