From 28f42e3db40ea792a2ee146ff0601a18f9e29395 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Tue, 14 Apr 2020 17:22:51 +0200 Subject: Fixed a whole lot of issues --- src/ft_bad_boy_actions.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'src/ft_bad_boy_actions.c') diff --git a/src/ft_bad_boy_actions.c b/src/ft_bad_boy_actions.c index 220e5ee..ea2822c 100644 --- a/src/ft_bad_boy_actions.c +++ b/src/ft_bad_boy_actions.c @@ -34,8 +34,8 @@ void ** 3: goes east */ -static int8_t - ft_bb_actual_walk(t_bad_boy *bl, t_sprite *sl, t_map *ml) +void + ft_bb_walk(t_bad_boy *bl, t_sprite *sl, t_map *ml) { int8_t r; const double old_x = sl->s_pos_x; @@ -54,18 +54,10 @@ static int8_t sl->s_pos_x -= (FT_MOVE_SPEED * 1.5); else if (r == 3) sl->s_pos_x += (FT_MOVE_SPEED * 1.5); - if (ft_bb_collision(old_y, old_x, sl, ml)) - return (ft_bb_actual_walk(bl, sl, ml)); + ft_bb_collision(old_y, old_x, sl, ml); ml->map[(uint64_t)old_y][(uint64_t)old_x] = '0'; ml->map[(uint64_t)sl->s_pos_y][(uint64_t)sl->s_pos_x] = 'e'; bl->does = 1; - return (0); -} - -void - ft_bb_walk(t_bad_boy *bl, t_sprite *sl, t_map *ml) -{ - ft_bb_actual_walk(bl, sl, ml); } /* -- cgit v1.2.3