From 14b08c7f6a5fc0efa61af63ef651fd444b00b697 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Mon, 30 Mar 2020 21:16:48 +0200 Subject: Nigga be shootin' quick af --- src/ft_bad_boy_actions.c | 6 +++--- 1 file changed, 3 insertions(+), 3 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 eada61a..3e961fb 100644 --- a/src/ft_bad_boy_actions.c +++ b/src/ft_bad_boy_actions.c @@ -12,6 +12,7 @@ #include #include +#include #include #include @@ -26,11 +27,10 @@ void static void ft_bb_collision(double old_y, double old_x, t_sprite *sl, t_map *ml) { - if (!ft_ischarset("0e", ml->map[(uint64_t)old_y][(uint64_t)old_x])) - { + if (!ft_ischarset("0e", ml->map[lround(old_y)][lround(sl->s_pos_x)])) sl->s_pos_x = old_x; + if (!ft_ischarset("0e", ml->map[lround(sl->s_pos_y)][lround(old_x)])) sl->s_pos_y = old_y; - } } void -- cgit v1.2.3