From 5be59b518283b4737949bcbea597068df43487dc Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Wed, 18 Mar 2020 22:34:45 +0100 Subject: Bug fix --- src/ft_draw_heals_extra.c | 2 +- src/ft_find_item.c | 3 ++- src/ft_raycasting.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ft_draw_heals_extra.c b/src/ft_draw_heals_extra.c index 05ff830..62c64b0 100644 --- a/src/ft_draw_heals_extra.c +++ b/src/ft_draw_heals_extra.c @@ -23,7 +23,7 @@ void int32_t i; i = 0; - while (i < cl->mlist.traps_nbr) + while (i < cl->mlist.heals_nbr) { sprite = cl->heals[i]; sprite.spritey = sprite.s_pos_x - (cl->plist.pos_x - 0.5); diff --git a/src/ft_find_item.c b/src/ft_find_item.c index 782a24a..d00b62d 100644 --- a/src/ft_find_item.c +++ b/src/ft_find_item.c @@ -33,6 +33,7 @@ void ft_find_item(t_player *pl, t_map *ml, t_cub *cl) { uint16_t id; + if (ft_ischarset(FT_CHRST_ITEM, ml->map[(uint64_t)pl->pos_y][(uint64_t)pl->pos_x])) { @@ -43,7 +44,7 @@ void pl->life = (pl->life > 100) ? (100) : (pl->life); ml->map[(uint64_t)pl->pos_y][(uint64_t)pl->pos_x] = '0'; id = ft_fetch_heals_id((uint64_t)pl->pos_y, - (uint64_t)pl->pos_x, cl); + (uint64_t)pl->pos_x, cl); cl->heals[id].s_pos_x = 0; cl->heals[id].s_pos_y = 0; /* TODO: ft_sfx_heal(3) */ diff --git a/src/ft_raycasting.c b/src/ft_raycasting.c index d805cdf..2d7df79 100644 --- a/src/ft_raycasting.c +++ b/src/ft_raycasting.c @@ -106,8 +106,8 @@ void } ft_floor_cast(cl); ft_calc_sprite(cl); - ft_calc_trap(cl); ft_calc_heal(cl); + ft_calc_trap(cl); ft_memdel((void*)&cl->rlist.wall_dist_tab); ft_memdel((void*)&cl->rlist.wall_bz); } -- cgit v1.2.3