diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-04-14 16:09:15 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-04-14 16:09:15 +0200 |
commit | 3d3af4f7d3487af8164c97134e06ca84b1ffd226 (patch) | |
tree | dab53082e9b84fbb87db718810d8ec14570e8029 | |
parent | Back to GCC for correction (diff) | |
download | 42-cub3d-3d3af4f7d3487af8164c97134e06ca84b1ffd226.tar.gz 42-cub3d-3d3af4f7d3487af8164c97134e06ca84b1ffd226.tar.bz2 42-cub3d-3d3af4f7d3487af8164c97134e06ca84b1ffd226.tar.xz 42-cub3d-3d3af4f7d3487af8164c97134e06ca84b1ffd226.tar.zst 42-cub3d-3d3af4f7d3487af8164c97134e06ca84b1ffd226.zip |
Bad boys do not eat walls anymore
-rw-r--r-- | map/map_seven.cub | 8 | ||||
-rw-r--r-- | minilibx_linux/Makefile.gen | 2 | ||||
-rw-r--r-- | minilibx_linux/Makefile.mk | 2 | ||||
-rw-r--r-- | src/ft_bad_boy_actions.c | 8 | ||||
-rw-r--r-- | src/ft_shoot.c | 2 |
5 files changed, 10 insertions, 12 deletions
diff --git a/map/map_seven.cub b/map/map_seven.cub index 9b69059..bdd5427 100644 --- a/map/map_seven.cub +++ b/map/map_seven.cub @@ -17,12 +17,12 @@ C 150,150,150 1000000000000000001 1000000000000000001 1000000000000000001 -1000000011100000001 -100000001e100000001 -1000000011100000001 +1000000010100000001 +100000000e000000001 +1000000010100000001 1000000000000000001 1000000000000000001 1000000!@#000000001 1000000000000000001 -100000000N000000001 +10N0000000000000001 1111111111111111111 diff --git a/minilibx_linux/Makefile.gen b/minilibx_linux/Makefile.gen index 5e2b3c1..f93b892 100644 --- a/minilibx_linux/Makefile.gen +++ b/minilibx_linux/Makefile.gen @@ -15,7 +15,7 @@ DOCP=do_cp -CC = clang +CC = gcc NAME = libmlx.a diff --git a/minilibx_linux/Makefile.mk b/minilibx_linux/Makefile.mk index 189d072..4f919ac 100644 --- a/minilibx_linux/Makefile.mk +++ b/minilibx_linux/Makefile.mk @@ -15,7 +15,7 @@ INC = %%%% HT = %%%% DOCP = %%%% -CC = clang +CC = gcc NAME = libmlx.a 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; } diff --git a/src/ft_shoot.c b/src/ft_shoot.c index dbd8862..7e0c90a 100644 --- a/src/ft_shoot.c +++ b/src/ft_shoot.c @@ -97,10 +97,8 @@ static void void ft_shoot(t_cub *cl) { - t_win *wl; t_player *pl; - wl = &cl->wlist; pl = &cl->plist; cl->rlist.y_ray_pos = pl->pos_y; cl->rlist.x_ray_pos = pl->pos_x; |