Skip to content

Commit 93e7a94

Browse files
committed
fixed pathfinding bug
1 parent 8f65183 commit 93e7a94

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

source/pathfinding/a_star.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ namespace omath::pathfinding
8787

8888
const auto current_node = current_node_it->second;
8989

90+
closed_list.emplace(current, current_node);
91+
9092
if (current == end_vertex)
9193
return reconstruct_final_path(closed_list, current);
9294

93-
closed_list.emplace(current, current_node);
94-
9595
for (const auto& neighbor: nav_mesh.get_neighbors(current))
9696
{
9797
if (closed_list.contains(neighbor))

0 commit comments

Comments
 (0)