aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_warp_level.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ft_warp_level.c')
-rw-r--r--src/ft_warp_level.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/ft_warp_level.c b/src/ft_warp_level.c
index 3c9110f..a4f705b 100644
--- a/src/ft_warp_level.c
+++ b/src/ft_warp_level.c
@@ -47,16 +47,7 @@ static void
{
uint8_t i;
- cl->plist.pos_x = 0;
- cl->plist.pos_y = 0;
- cl->plist.pos_z = 0;
- cl->plist.start_x = 0;
- cl->plist.start_y = 0;
- cl->plist.cam_x = 0;
- cl->plist.dir_x = -1;
- cl->plist.dir_y = 0;
- cl->plist.plane_x = 0;
- cl->plist.plane_y = 0.66;
+ cl->plist = ft_init_player();
cl->f_rgb = ft_init_rgb();
cl->c_rgb = ft_init_rgb();
cl->rlist = ft_init_s_ray();
@@ -70,6 +61,8 @@ static void
mlx_destroy_image(cl->wlist.wlx, cl->tlist[6].img);
if (cl->mlist.isctex && cl->tlist[7].img)
mlx_destroy_image(cl->wlist.wlx, cl->tlist[7].img);
+ if (cl->mlist.istrap && cl->tlist[15].img)
+ mlx_destroy_image(cl->wlist.wlx, cl->tlist[15].img);
}
static void
@@ -100,9 +93,6 @@ int8_t
char *tmp_mup;
uint8_t isoldmus;
- if ((uint32_t)cl->plist.pos_x == cl->mlist.nlx &&
- (uint32_t)cl->plist.pos_y == cl->mlist.nly)
- {
if (!(next_path = (char *)malloc((ft_strlen(
cl->mlist.nlevel_path) + 1) * sizeof(char))))
return (-1);
@@ -119,6 +109,5 @@ int8_t
ft_memdel((void**)&tmp_mup);
ft_wall_tex_init(cl);
ft_memdel((void**)&next_path);
- }
return (0);
}