diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-30 21:16:48 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-30 21:16:48 +0200 |
commit | 14b08c7f6a5fc0efa61af63ef651fd444b00b697 (patch) | |
tree | b8b0f72d26d615f7cc5e6c3c6e7fa96a593753a3 /src/ft_bad_boy_actions.c | |
parent | Fine (diff) | |
download | 42-cub3d-14b08c7f6a5fc0efa61af63ef651fd444b00b697.tar.gz 42-cub3d-14b08c7f6a5fc0efa61af63ef651fd444b00b697.tar.bz2 42-cub3d-14b08c7f6a5fc0efa61af63ef651fd444b00b697.tar.xz 42-cub3d-14b08c7f6a5fc0efa61af63ef651fd444b00b697.tar.zst 42-cub3d-14b08c7f6a5fc0efa61af63ef651fd444b00b697.zip |
Nigga be shootin' quick af
Diffstat (limited to '')
-rw-r--r-- | src/ft_bad_boy_actions.c | 6 |
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 |