aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_get_map.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ft_get_map.c')
-rw-r--r--src/ft_get_map.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ft_get_map.c b/src/ft_get_map.c
index 4cb4941..d2f0a31 100644
--- a/src/ft_get_map.c
+++ b/src/ft_get_map.c
@@ -17,7 +17,7 @@
#include <stdint.h>
static void
- ft_linecpy(char *line, char *mapl, size_t start)
+ ft_linecpy(char *line, char *mapl, size_t start, t_cub *cl)
{
size_t i;
size_t j;
@@ -29,6 +29,9 @@ static void
while (i < slen && line[i])
{
mapl[j] = line[i];
+ if (mapl[j] - 48 > 2 && mapl[j] - 48 < 10
+ && mapl[j] - 48 > cl->mlist.topsp)
+ ft_error(FT_RET_MAP_ERR, FT_ERR_UNDEF_SPRITE, cl);
i++;
j++;
}
@@ -47,7 +50,7 @@ static int8_t
return (-1);
}
ft_linecpy(line, clist->mlist.mapl,
- clist->mlist.mapl_len);
+ clist->mlist.mapl_len, clist);
clist->mlist.mapl_len += ft_strlen(line) + 1;
return (0);
}