From 288610afeb6e6e9f439d2178cd5c9aeb1a15ff69 Mon Sep 17 00:00:00 2001 From: Maelys Date: Thu, 24 Oct 2024 14:31:15 +0200 Subject: [PATCH] fix error map close --- includes/parsing.h | 4 ++-- map.cub | 19 ++++--------------- src/cub3d.c | 2 +- src/parsing/check_map.c | 4 +++- 4 files changed, 10 insertions(+), 19 deletions(-) diff --git a/includes/parsing.h b/includes/parsing.h index 409583c..879c486 100644 --- a/includes/parsing.h +++ b/includes/parsing.h @@ -6,7 +6,7 @@ /* By: madumerg +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/09/12 12:49:16 by madumerg #+# #+# */ -/* Updated: 2024/10/05 18:43:16 by madumerg ### ########.fr */ +/* Updated: 2024/10/06 16:16:31 by madumerg ### ########.fr */ /* */ /* ************************************************************************** */ @@ -88,7 +88,7 @@ int space_line(char *line); //parse_utils_two.c int ft_count_line_map(char **map, int y); -void replace_nl(char *l); +int replace_nl(char *l); int recup_map(char **old_map, int i, t_pars *pars); int all_skip(char **map, t_pars *pars); diff --git a/map.cub b/map.cub index 2510b1f..a4f0d77 100755 --- a/map.cub +++ b/map.cub @@ -8,23 +8,12 @@ EA ./ea_texture.png C 255,100,200 F 50,0,250 - -111111 +11111 1000W1 -1111111 - +111111 11111111111111 - 11 - 11101 +111111111111 +0 11101 1111111111111111 - - - 111111111111111 111111111111111111111111 - - - - - - diff --git a/src/cub3d.c b/src/cub3d.c index 11442ac..495ec65 100644 --- a/src/cub3d.c +++ b/src/cub3d.c @@ -6,7 +6,7 @@ /* By: madumerg +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/09/04 16:58:27 by madumerg #+# #+# */ -/* Updated: 2024/10/05 18:45:09 by madumerg ### ########.fr */ +/* Updated: 2024/10/05 19:18:00 by madumerg ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/src/parsing/check_map.c b/src/parsing/check_map.c index 305ab98..77c5650 100644 --- a/src/parsing/check_map.c +++ b/src/parsing/check_map.c @@ -6,7 +6,7 @@ /* By: madumerg +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/09/11 11:24:13 by madumerg #+# #+# */ -/* Updated: 2024/10/07 11:45:16 by madumerg ### ########.fr */ +/* Updated: 2024/10/24 14:30:13 by madumerg ### ########.fr */ /* */ /* ************************************************************************** */ @@ -46,6 +46,8 @@ int check_map_close(char **map) x = 0; while (map[y][x]) { + if (actual_char(map[y][0]) == 0) + return (1); if (actual_char(map[y][x]) == 0 && \ (err_not_close(map[y][x + 1], map[y][x - 1], \ map[y + 1][x], map[y - 1][x]) == 1))