diff options
Diffstat (limited to 'src/ft_get_traps.c')
-rw-r--r-- | src/ft_get_traps.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ft_get_traps.c b/src/ft_get_traps.c index b7d12e1..fef3179 100644 --- a/src/ft_get_traps.c +++ b/src/ft_get_traps.c @@ -1,7 +1,7 @@ /* ************************************************************************** */ /* */ /* ::: :::::::: */ -/* ft_get_tex_nl.c :+: :+: :+: */ +/* ft_get_traps.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: rbousset <marvin@42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ @@ -19,7 +19,7 @@ void { size_t x; size_t y; - uint8_t i; + uint16_t i; x = 1; y = 1; @@ -31,6 +31,8 @@ void if (clist->mlist.map[y][x] == 'T') { clist->mlist.traps_nbr++; + if (clist->mlist.traps_nbr > 512) + ft_map_error(FT_ERR_TOO_MUCH_TRAPS, clist); clist->traps[i].s_pos_x = x; clist->traps[i].s_pos_y = y; i++; |