diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-04-19 18:46:10 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-04-19 18:46:10 +0200 |
commit | 5f6b5490f80be9e792ccaeb18548cca54a62826f (patch) | |
tree | 029898cbaa860a060cb01b8db62c5b4414af8812 /src/ft_damage_bad_boy.c | |
parent | Minilibx update (diff) | |
download | 42-cub3d-5f6b5490f80be9e792ccaeb18548cca54a62826f.tar.gz 42-cub3d-5f6b5490f80be9e792ccaeb18548cca54a62826f.tar.bz2 42-cub3d-5f6b5490f80be9e792ccaeb18548cca54a62826f.tar.xz 42-cub3d-5f6b5490f80be9e792ccaeb18548cca54a62826f.tar.zst 42-cub3d-5f6b5490f80be9e792ccaeb18548cca54a62826f.zip |
Fixed enemy hitbox
Diffstat (limited to '')
-rw-r--r-- | src/ft_damage_bad_boy.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ft_damage_bad_boy.c b/src/ft_damage_bad_boy.c index ffbd2fe..36c082f 100644 --- a/src/ft_damage_bad_boy.c +++ b/src/ft_damage_bad_boy.c @@ -22,8 +22,8 @@ static uint8_t i = 0; while (i < cl->mlist.sprite_nbr[13]) { - if ((uint64_t)cl->sprites[13][i].s_pos_x == cl->rlist.sqx && - (uint64_t)cl->sprites[13][i].s_pos_y == cl->rlist.sqy) + if (llround(cl->sprites[13][i].s_pos_x) == (int64_t)cl->rlist.sqx && + llround(cl->sprites[13][i].s_pos_y) == (int64_t)cl->rlist.sqy) break ; i++; } @@ -47,8 +47,8 @@ void { cl->sfx[13].sfx_play(cl->sfx); cl->bad_boy[id].isdead = 1; - cl->mlist.map[(uint64_t)cl->sprites[13][id].s_pos_y] - [(uint64_t)cl->sprites[13][id].s_pos_x] = 'x'; + cl->mlist.map[llround(cl->sprites[13][id].s_pos_y)] + [llround(cl->sprites[13][id].s_pos_x)] = 'x'; } else if (cl->bad_boy[id].does != 3) cl->sfx[14].sfx_play(cl->sfx); |