From 93e7a9457abd2431c7d76d22a759e499f3b0565a Mon Sep 17 00:00:00 2001 From: va_alpatov Date: Sat, 11 Apr 2026 20:06:39 +0300 Subject: [PATCH] fixed pathfinding bug --- source/pathfinding/a_star.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/pathfinding/a_star.cpp b/source/pathfinding/a_star.cpp index a2bff25..6a116b4 100644 --- a/source/pathfinding/a_star.cpp +++ b/source/pathfinding/a_star.cpp @@ -87,11 +87,11 @@ namespace omath::pathfinding const auto current_node = current_node_it->second; + closed_list.emplace(current, current_node); + if (current == end_vertex) return reconstruct_final_path(closed_list, current); - closed_list.emplace(current, current_node); - for (const auto& neighbor: nav_mesh.get_neighbors(current)) { if (closed_list.contains(neighbor))