diff options
author | salad <salad@saladesk.desktop> | 2020-03-23 18:00:29 +0100 |
---|---|---|
committer | salad <salad@saladesk.desktop> | 2020-03-23 18:00:29 +0100 |
commit | 006862cd0998804a979180c509d0e2da4afec948 (patch) | |
tree | ec00236f08c461cec11884d116cec83a2ca4838a /src/ft_shoot.c | |
parent | GAME AWARDS 2020 (diff) | |
download | 42-cub3d-006862cd0998804a979180c509d0e2da4afec948.tar.gz 42-cub3d-006862cd0998804a979180c509d0e2da4afec948.tar.bz2 42-cub3d-006862cd0998804a979180c509d0e2da4afec948.tar.xz 42-cub3d-006862cd0998804a979180c509d0e2da4afec948.tar.zst 42-cub3d-006862cd0998804a979180c509d0e2da4afec948.zip |
about to norm this mans whole career
Diffstat (limited to 'src/ft_shoot.c')
-rw-r--r-- | src/ft_shoot.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/ft_shoot.c b/src/ft_shoot.c index ab820e6..73a9617 100644 --- a/src/ft_shoot.c +++ b/src/ft_shoot.c @@ -12,6 +12,20 @@ #include <cub3d.h> #include <libft.h> +#include <stdio.h> + +static void + ft_reset_sprites(t_cub *cl) +{ + uint16_t i; + uint16_t tmp; + + tmp = cl->mlist.sprite_var; + while(++i < tmp + 1) + { + ft_bzero(cl->sprites[i], sizeof(t_sprite)); + } +} static void ft_hitscan(t_cub *cl, uint16_t hit) @@ -35,6 +49,7 @@ static void { hit = 1; cl->mlist.map[cl->rlist.sqx][cl->rlist.sqy] = '0'; + ft_reset_sprites(cl); ft_get_sprite_spawn(cl); } else if (ft_ischarset("1", |