From 4fe3a87d3c09a22da49fb1f3e49e26751e7d4471 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Sun, 15 Mar 2020 14:36:36 +0100 Subject: ok --- src/ft_key_loop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/ft_key_loop.c') diff --git a/src/ft_key_loop.c b/src/ft_key_loop.c index c16655e..5b6fee4 100644 --- a/src/ft_key_loop.c +++ b/src/ft_key_loop.c @@ -95,7 +95,7 @@ int } i++; } - if (cl->key_input[0] != -1) + /* if (cl->key_input[0] != -1) */ ft_draw_scene(cl); return (0); } -- cgit v1.2.3 From 163bed0c8988ff020b746bf96dc01dd2058dc4f9 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Sun, 15 Mar 2020 15:09:59 +0100 Subject: Footsteps are bav --- src/ft_key_loop.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/ft_key_loop.c') diff --git a/src/ft_key_loop.c b/src/ft_key_loop.c index 5b6fee4..df97380 100644 --- a/src/ft_key_loop.c +++ b/src/ft_key_loop.c @@ -82,15 +82,19 @@ int while (i < 5 && cl->key_input[i] != -1 && cl->key_input[i] <= 5) { cl->key_ptr[cl->key_input[i]](cl); - ft_collision(old_y, old_x, cl->key_input[i], cl); - if (cl->mlist.isnlvl) + if (cl->key_input[i] >= 0 && cl->key_input[i] <= 3) { - if ((uint32_t)cl->plist.pos_x == cl->mlist.nlx && - (uint32_t)cl->plist.pos_y == cl->mlist.nly) + ft_sfx_footstep(cl); + ft_collision(old_y, old_x, cl->key_input[i], cl); + if (cl->mlist.isnlvl) { - ft_sfx_new_level(cl); - return ((ft_warp_level(cl->mlist.nlevel_path, cl) < 0) ? - (ft_exit(FT_RET_FAILED_STRUCTS, cl)) : (0)); + if ((uint32_t)cl->plist.pos_x == cl->mlist.nlx && + (uint32_t)cl->plist.pos_y == cl->mlist.nly) + { + ft_sfx_new_level(cl); + return ((ft_warp_level(cl->mlist.nlevel_path, cl) < 0) ? + (ft_exit(FT_RET_FAILED_STRUCTS, cl)) : (0)); + } } } i++; -- cgit v1.2.3