From 958fc1d689fcbccd75c6817e7a0e6fa921b3088b Mon Sep 17 00:00:00 2001 From: MihailRis Date: Sat, 2 Aug 2025 12:19:52 +0300 Subject: [PATCH] fix target reach check --- src/voxels/Pathfinding.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/voxels/Pathfinding.cpp b/src/voxels/Pathfinding.cpp index 59da59f2..4282d5bb 100644 --- a/src/voxels/Pathfinding.cpp +++ b/src/voxels/Pathfinding.cpp @@ -94,7 +94,7 @@ Route Pathfinding::perform( auto node = queue.top(); queue.pop(); - if (node.pos.x == end.x && node.pos.z == end.z) { + if (node.pos.x == end.x && glm::abs((node.pos.y - end.y) / agent.height) == 0 && node.pos.z == end.z) { restore_route(route, node, parents); route.nodes.push_back({start}); route.found = true;