diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-31 15:28:02 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-31 15:28:02 +0200 |
commit | b826970c9c3d8fb890543cabf17b1e7144582e0e (patch) | |
tree | c0188f5a63a267c21822ebe866f8c74b741793f6 /src/ft_damage_bad_boy.c | |
parent | Now that's what I call balance take this SC2 'balance' team haha more like sc... (diff) | |
download | 42-cub3d-b826970c9c3d8fb890543cabf17b1e7144582e0e.tar.gz 42-cub3d-b826970c9c3d8fb890543cabf17b1e7144582e0e.tar.bz2 42-cub3d-b826970c9c3d8fb890543cabf17b1e7144582e0e.tar.xz 42-cub3d-b826970c9c3d8fb890543cabf17b1e7144582e0e.tar.zst 42-cub3d-b826970c9c3d8fb890543cabf17b1e7144582e0e.zip |
Good
Diffstat (limited to 'src/ft_damage_bad_boy.c')
-rw-r--r-- | src/ft_damage_bad_boy.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ft_damage_bad_boy.c b/src/ft_damage_bad_boy.c index b6eb7df..c9cb66c 100644 --- a/src/ft_damage_bad_boy.c +++ b/src/ft_damage_bad_boy.c @@ -12,6 +12,7 @@ #include <libft.h> #include <cub3d.h> +#include <math.h> static uint8_t ft_get_bad_boy_id(t_cub *cl) @@ -21,12 +22,12 @@ static uint8_t i = 0; while (i < cl->mlist.sprite_nbr[13]) { - if (cl->sprites[13][i].s_pos_x == cl->rlist.sqy && - cl->sprites[13][i].s_pos_y == cl->rlist.sqx) - return (i); + if (lround(cl->sprites[13][i].s_pos_x) == (long)cl->rlist.sqy && + lround(cl->sprites[13][i].s_pos_y) == (long)cl->rlist.sqx) + break ; i++; } - return (0); + return (i); } void @@ -41,6 +42,5 @@ void cl->bad_boy[id].life -= FT_W_TWO_DANAGE_AMOUNT; else if (cl->plist.handles_weapon == 4) cl->bad_boy[id].life -= FT_W_THREE_DANAGE_AMOUNT; - ft_printf("%hhd\n", cl->bad_boy[0].life); /* TODO: sfx enemy scream and death */ } |