From 1bd6b6e64b02ce70e193bb108843bc0ee5c051c3 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Thu, 19 Mar 2020 14:00:59 +0100 Subject: Correct init and frees --- src/ft_warp_level.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/ft_warp_level.c') diff --git a/src/ft_warp_level.c b/src/ft_warp_level.c index 09f0322..d6a3d7f 100644 --- a/src/ft_warp_level.c +++ b/src/ft_warp_level.c @@ -65,6 +65,18 @@ static void mlx_destroy_image(cl->wlist.wlx, cl->tlist[16].img); if (cl->mlist.isheals && cl->tlist[17].img) mlx_destroy_image(cl->wlist.wlx, cl->tlist[17].img); + if (cl->mlist.isweapon[0] && cl->tlist[18].img) + mlx_destroy_image(cl->wlist.wlx, cl->tlist[18].img); + if (cl->mlist.isweapon[1] && cl->tlist[19].img) + mlx_destroy_image(cl->wlist.wlx, cl->tlist[19].img); + if (cl->tweap[0].img) + mlx_destroy_image(cl->wlist.wlx, cl->tweap[0].img); + if (cl->tweap[1].img) + mlx_destroy_image(cl->wlist.wlx, cl->tweap[1].img); + if (cl->tweap[2].img) + mlx_destroy_image(cl->wlist.wlx, cl->tweap[2].img); + if (cl->tweap[3].img) + mlx_destroy_image(cl->wlist.wlx, cl->tweap[3].img); ft_del_extra_sprites(cl); i = -1; while (++i < 8) -- cgit v1.2.3