aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_get_traps.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-18 21:35:54 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-18 21:35:54 +0100
commitd114d2571a3808eba1f0a5038ad862b790a96074 (patch)
tree8d2d4c19a2a8de61a253dc0a4fc2434a770470a6 /src/ft_get_traps.c
parentMerge branch 'better_sprites' (diff)
download42-cub3d-d114d2571a3808eba1f0a5038ad862b790a96074.tar.gz
42-cub3d-d114d2571a3808eba1f0a5038ad862b790a96074.tar.bz2
42-cub3d-d114d2571a3808eba1f0a5038ad862b790a96074.tar.xz
42-cub3d-d114d2571a3808eba1f0a5038ad862b790a96074.tar.zst
42-cub3d-d114d2571a3808eba1f0a5038ad862b790a96074.zip
In progress
Diffstat (limited to 'src/ft_get_traps.c')
-rw-r--r--src/ft_get_traps.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ft_get_traps.c b/src/ft_get_traps.c
index b7d12e1..2d652f8 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> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
@@ -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++;