From 0e6abebb7b8957fee98be378c7cd71e0f1835874 Mon Sep 17 00:00:00 2001 From: Ladebeze66 Date: Tue, 30 Jan 2024 17:00:04 +0100 Subject: [PATCH] okmulti --- cub3d.h | 2 +- map.cub | 8 ++++---- parsing/ft_find_player_position.c | 10 +++------- parsing/ft_find_player_utils.c | 2 +- 4 files changed, 9 insertions(+), 13 deletions(-) diff --git a/cub3d.h b/cub3d.h index 1fcf0e5..a397573 100644 --- a/cub3d.h +++ b/cub3d.h @@ -6,7 +6,7 @@ /* By: fgras-ca +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/01/14 16:56:52 by fgras-ca #+# #+# */ -/* Updated: 2024/01/30 15:47:04 by fgras-ca ### ########.fr */ +/* Updated: 2024/01/30 16:44:11 by fgras-ca ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/map.cub b/map.cub index d74c3d2..5490dc1 100644 --- a/map.cub +++ b/map.cub @@ -10,13 +10,13 @@ C 165, 176, 196 1111100000000000000000000000000000001 10000000001 10000000000000000000000000000000000002000000000000000000000001 1000000000000000000000011111111111111 10000000001 10000000000000000000000000000000000002000000000000000000000001111 100000000000000000000001 10000000001 10000000000000000000000000000000001111111100000000000000000000001 -100000000000000000000001111111111111111111000000000111110000000000000000000000000000000001 100000000000000000000001 +100000000000000000000001111111111111111111000000000111110000000000000000S00000000000000001 100000000000000000000001 100000000000000000000000000000000000000000000000000002000000000000000000000000000000000001 111111111111000000000001 100000000000000000111100000000000000000000000000000002000000000000000000000000000000000001 1000000000001 1000000000000000001 100000000000000000000000000000002000000000000000000000000000011111111 1000000000001 -100000000000000000111100000000000000000000000000000002000000000000000000000000000011111111111111111111111 1000000000001 -100000000000000000000000000000000000000000000000000002000000000000000W00000000000000000000000000000000001 1000000000001 -110000000000011111100000000000000000000000000000000002000000000000000000000000000000000000000000000000001 1000000000001 +10000000000000000011110000000000000000000000000000000200000000000000E000000000000011111111111111111111111 1000000000001 +100000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000001 1000000000001 +110000000000011111100000000000000N00000000000000000002000000000000000000000000000000000000000000000000001 1000000000001 1000000000001 100000000000000000000000000000000002000000000000000000000000000000000000000000000000001 1000000000001 11000000000001 100000000000000000000000000000000002000000000000000000000000000000000000000000000000001 1000000000001 100000000000011111100000000000000000000000000000000002000000000000000000000000000000000000000000000000001 1000000000001 diff --git a/parsing/ft_find_player_position.c b/parsing/ft_find_player_position.c index 9316a34..cde5f3b 100644 --- a/parsing/ft_find_player_position.c +++ b/parsing/ft_find_player_position.c @@ -6,7 +6,7 @@ /* By: fgras-ca +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/01/23 19:54:51 by fgras-ca #+# #+# */ -/* Updated: 2024/01/29 18:58:31 by fgras-ca ### ########.fr */ +/* Updated: 2024/01/30 16:59:15 by fgras-ca ### ########.fr */ /* */ /* ************************************************************************** */ @@ -29,7 +29,6 @@ static bool process_player_char(char current_char, t_player_info *player_info) } else { - printf("Multiple player start positions found. Invalid map.\n"); return (false); } } @@ -49,11 +48,8 @@ bool find_player(const char *map_content, int length, t_structure_map *map) player_info.found_player = &found_player; while (i < length) { - if (!found_player) - { - if (!process_player_char(map_content[i], &player_info)) - return (false); - } + if (!process_player_char(map_content[i], &player_info)) + return (false); calculate_map(map); update_position(map_content[i], &player_info.line_number, &player_info.column_number); diff --git a/parsing/ft_find_player_utils.c b/parsing/ft_find_player_utils.c index 53a703c..469504e 100644 --- a/parsing/ft_find_player_utils.c +++ b/parsing/ft_find_player_utils.c @@ -6,7 +6,7 @@ /* By: fgras-ca +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/01/29 18:57:38 by fgras-ca #+# #+# */ -/* Updated: 2024/01/29 18:58:26 by fgras-ca ### ########.fr */ +/* Updated: 2024/01/30 16:50:06 by fgras-ca ### ########.fr */ /* */ /* ************************************************************************** */