aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_check_map_line.c
diff options
context:
space:
mode:
authorRudy Bousset <rbousset@z2r5p2.le-101.fr>2020-02-28 18:55:45 +0100
committerRudy Bousset <rbousset@z2r5p2.le-101.fr>2020-02-28 18:55:45 +0100
commitcbb47afbbcc9b42f3094df620bbc0ef02aa7f3d2 (patch)
tree1e0aa232748e071c10779ed7dbf641178d85664e /src/ft_check_map_line.c
parentIn progress (diff)
download42-cub3d-cbb47afbbcc9b42f3094df620bbc0ef02aa7f3d2.tar.gz
42-cub3d-cbb47afbbcc9b42f3094df620bbc0ef02aa7f3d2.tar.bz2
42-cub3d-cbb47afbbcc9b42f3094df620bbc0ef02aa7f3d2.tar.xz
42-cub3d-cbb47afbbcc9b42f3094df620bbc0ef02aa7f3d2.tar.zst
42-cub3d-cbb47afbbcc9b42f3094df620bbc0ef02aa7f3d2.zip
Parsed
Diffstat (limited to 'src/ft_check_map_line.c')
-rw-r--r--src/ft_check_map_line.c9
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);
}