From bee91cfd7cedaf347818a1f084b641ceb78aa6bb Mon Sep 17 00:00:00 2001 From: mcolonna Date: Fri, 19 Apr 2024 17:41:08 +0200 Subject: [PATCH] fix: possible infinite loop when pathfinding --- src/room/pathfinding.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/room/pathfinding.c b/src/room/pathfinding.c index 4d47324..4cb4c33 100644 --- a/src/room/pathfinding.c +++ b/src/room/pathfinding.c @@ -6,7 +6,7 @@ /* By: mcolonna +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/04/10 18:19:19 by mcolonna #+# #+# */ -/* Updated: 2024/04/18 16:03:05 by mcolonna ### ########.fr */ +/* Updated: 2024/04/19 17:32:16 by mcolonna ### ########.fr */ /* */ /* ************************************************************************** */ @@ -80,6 +80,7 @@ t_direction pathfinding(t_point start, t_point finish, bool for_firsk) map = init_map(env.mc, for_firsk); tocheck = inittochecklist(env.mc, map.dim, start); case_checking = start; + ((t_path_map_case *)*map_at(&map, start))->to_check = true; while (case_checking.x != -1 || case_checking.y != -1) { r = pathfinding_checkdirections(&tocheck, case_checking, &map, env);