aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_del_tex.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ft_del_tex.c')
-rw-r--r--src/ft_del_tex.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/ft_del_tex.c b/src/ft_del_tex.c
index fc0cf99..5e53366 100644
--- a/src/ft_del_tex.c
+++ b/src/ft_del_tex.c
@@ -20,7 +20,7 @@ static void
uint8_t i;
i = 1;
- while ((i + 2) <= cl->mlist.topsp)
+ while (cl->mlist.sprite_path[i][0])
{
if (cl->tlist[i + 7].img)
mlx_destroy_image(cl->wlist.wlx, cl->tlist[i + 7].img);
@@ -54,6 +54,13 @@ static void
mlx_destroy_image(cl->wlist.wlx, cl->tweap[i].img);
i++;
}
+ i = 23;
+ while (i < 27)
+ {
+ if (cl->tlist[i].img)
+ mlx_destroy_image(cl->wlist.wlx, cl->tlist[i].img);
+ i++;
+ }
}
static void