aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_bad_boy_actions.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ft_bad_boy_actions.c')
-rw-r--r--src/ft_bad_boy_actions.c6
1 files changed, 3 insertions, 3 deletions
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 <libft.h>
#include <cub3d.h>
+#include <mlx.h>
#include <stdlib.h>
#include <math.h>
@@ -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