From 22a93a5a589590a00a53878c45e551c69d0edb2a Mon Sep 17 00:00:00 2001 From: Baptiste Goulard coderc de lacam Date: Fri, 20 Dec 2024 16:35:37 +0100 Subject: [PATCH] Fix: fix on multiple player catch --- maps/bad_muplie_players__different_lines.cub | 14 +++++++++ maps/bad_muplie_players__oneline.cub | 11 +++++++ maps/valid_03_isle.cub | 30 ++++++++++++++++++++ parsing/load_tiles.c | 8 +++--- 4 files changed, 59 insertions(+), 4 deletions(-) create mode 100644 maps/bad_muplie_players__different_lines.cub create mode 100644 maps/bad_muplie_players__oneline.cub create mode 100644 maps/valid_03_isle.cub diff --git a/maps/bad_muplie_players__different_lines.cub b/maps/bad_muplie_players__different_lines.cub new file mode 100644 index 0000000..8db0e57 --- /dev/null +++ b/maps/bad_muplie_players__different_lines.cub @@ -0,0 +1,14 @@ +SO ./textures/chiseled_tuff.xpm +NO ./textures/chiseled_tuff_bricks.xpm +WE ./textures/chiseled_stone_bricks.xpm +EA ./textures/chiseled_tuff_bricks_top.xpm + +F 0,255,0 +C 0,255,255 + +111111 +1N0001 +10E001 +100W01 +1000S1 +111111 diff --git a/maps/bad_muplie_players__oneline.cub b/maps/bad_muplie_players__oneline.cub new file mode 100644 index 0000000..0ffa966 --- /dev/null +++ b/maps/bad_muplie_players__oneline.cub @@ -0,0 +1,11 @@ +SO ./textures/chiseled_tuff.xpm +NO ./textures/chiseled_tuff_bricks.xpm +WE ./textures/chiseled_stone_bricks.xpm +EA ./textures/chiseled_tuff_bricks_top.xpm + +F 0,255,0 +C 0,255,255 + +111111 +1NEWS1 +111111 diff --git a/maps/valid_03_isle.cub b/maps/valid_03_isle.cub new file mode 100644 index 0000000..31a2b63 --- /dev/null +++ b/maps/valid_03_isle.cub @@ -0,0 +1,30 @@ +SO ./textures/chiseled_tuff.xpm +NO ./textures/chiseled_tuff_bricks.xpm +WE ./textures/chiseled_stone_bricks.xpm +EA ./textures/chiseled_tuff_bricks_top.xpm + +F 0,255,0 +C 0,255,255 + + + + + + + + + + +1 1 1 11 1 +1111 1 111 1 1 +111 1 1 1 1 +11111111111111111111111 +100000000S0000000000001 0 +10000000000000000000001 +10000000000000000000001 1 +11111011101100111110011 1 +11000000000000000000001 +11110111111111111111111 1 +11111111 1 + 1 + 1 diff --git a/parsing/load_tiles.c b/parsing/load_tiles.c index 85448bf..fcaf4af 100644 --- a/parsing/load_tiles.c +++ b/parsing/load_tiles.c @@ -6,7 +6,7 @@ /* By: bgoulard +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/12/01 17:47:15 by bgoulard #+# #+# */ -/* Updated: 2024/12/20 15:59:04 by bgoulard ### ########.fr */ +/* Updated: 2024/12/20 16:35:03 by bgoulard ### ########.fr */ /* */ /* ************************************************************************** */ @@ -81,15 +81,15 @@ static bool multiple_player_same_line(const char *str) i = 0; while (i < 4) { - j = 0; + j = i + 1; while (j < 4) - if (p_symbol[j++] == true && p_symbol[i] == true) + if (!p_symbol[j++] && !p_symbol[i]) return (true); i++; } i = 0; while (i < 4) - if (p_symbol[i++ + 4]) + if (p_symbol[i++ + 4] && !p_symbol[i]) return (true); return (false); }