Fix: fix on multiple player catch

This commit is contained in:
Baptiste Goulard coderc de lacam 2024-12-20 16:35:37 +01:00
parent 4d2b8cb60b
commit 22a93a5a58
4 changed files with 59 additions and 4 deletions

View file

@ -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

View file

@ -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

30
maps/valid_03_isle.cub Normal file
View file

@ -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

View file

@ -6,7 +6,7 @@
/* By: bgoulard <bgoulard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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);
}