From b826970c9c3d8fb890543cabf17b1e7144582e0e Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Tue, 31 Mar 2020 15:28:02 +0200 Subject: Good --- src/ft_damage_bad_boy.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/ft_damage_bad_boy.c') 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 #include +#include 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 */ } -- cgit v1.2.3