diff options
Diffstat (limited to 'src/ft_bad_boy_actions.c')
-rw-r--r-- | src/ft_bad_boy_actions.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ft_bad_boy_actions.c b/src/ft_bad_boy_actions.c index 92fe3fa..269ba0d 100644 --- a/src/ft_bad_boy_actions.c +++ b/src/ft_bad_boy_actions.c @@ -27,9 +27,9 @@ void static void ft_bb_collision(double old_y, double old_x, t_sprite *sl, t_map *ml) { - if (!ft_ischarset("0e", ml->map[lround(old_y)][lround(sl->s_pos_x)])) + if (!ft_ischarset("0e", ml->map[(uint64_t)old_y][(uint64_t)sl->s_pos_x])) sl->s_pos_x = old_x; - if (!ft_ischarset("0e", ml->map[lround(sl->s_pos_y)][lround(old_x)])) + if (!ft_ischarset("0e", ml->map[(uint64_t)sl->s_pos_y][(uint64_t)old_x])) sl->s_pos_y = old_y; } @@ -56,8 +56,8 @@ void sl->s_pos_x += (FT_MOVE_SPEED * 1.5 * r_x); sl->s_pos_y += (FT_MOVE_SPEED * 1.5 * r_y); ft_bb_collision(old_y, old_x, sl, ml); - ml->map[lround(old_y)][lround(old_x)] = '0'; - ml->map[lround(sl->s_pos_y)][lround(sl->s_pos_x)] = 'e'; + 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; } |