plr orientation at begining
This commit is contained in:
@@ -6,17 +6,18 @@
|
||||
/* By: pblagoje <pblagoje@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/04/18 12:37:48 by pblagoje #+# #+# */
|
||||
/* Updated: 2022/04/30 11:56:09 by simplonco ### ########.fr */
|
||||
/* Updated: 2022/05/04 00:51:54 by simplonco ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "cube3d.h"
|
||||
|
||||
int set_player(t_map *map, int y, int x)
|
||||
static int set_player(t_map *map, int y, int x, char dir)
|
||||
{
|
||||
map->plr_x = x;
|
||||
map->plr_y = y;
|
||||
map->content[y][x] = '0';
|
||||
map->plr_dir = dir;
|
||||
return (1);
|
||||
}
|
||||
|
||||
@@ -76,7 +77,7 @@ int check_content(t_map *map)
|
||||
else if (!ft_strchr(" 01SNWE", map->content[y][x]))
|
||||
return (EXIT_FAILURE);
|
||||
else if (ft_strchr("SNWE", map->content[y][x]) \
|
||||
&& set_player(map, y, x))
|
||||
&& set_player(map, y, x, map->content[y][x]))
|
||||
count++;
|
||||
x++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user