diff options
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 */ } |