diff options
Diffstat (limited to 'src/ft_check_map_line.c')
-rw-r--r-- | src/ft_check_map_line.c | 9 |
1 files changed, 8 insertions, 1 deletions
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); } |