From cbb47afbbcc9b42f3094df620bbc0ef02aa7f3d2 Mon Sep 17 00:00:00 2001 From: Rudy Bousset Date: Fri, 28 Feb 2020 18:55:45 +0100 Subject: Parsed --- src/ft_check_map_line.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/ft_check_map_line.c') diff --git a/src/ft_check_map_line.c b/src/ft_check_map_line.c index 017d63a..184e489 100644 --- a/src/ft_check_map_line.c +++ b/src/ft_check_map_line.c @@ -18,7 +18,7 @@ static int8_t ft_first_checks(char *line, size_t i, t_cub *clist) { - if (!ft_ischarset("012NSEW ", line[i])) + if (!ft_ischarset("012NSEWL ", line[i])) { ft_sprintf(clist->errmsg, "%s", FT_ERR_ILL_MAP); return (-1); @@ -30,6 +30,13 @@ static int8_t ft_sprintf(clist->errmsg, "%s", FT_ERR_MULT_SPAWN); return (-1); } + if (line[i] == 'L') + clist->mlist->isnlvl += 1; + if (clist->mlist->isnlvl > 1) + { + ft_sprintf(clist->errmsg, "%s", FT_ERR_MULT_NLVL); + return (-1); + } return (0); } -- cgit v1.2.3