diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ft_damage_bad_boy.c | 2 | ||||
-rw-r--r-- | src/ft_draw_sprite.c | 7 | ||||
-rw-r--r-- | src/ft_find_item.c | 19 |
3 files changed, 17 insertions, 11 deletions
diff --git a/src/ft_damage_bad_boy.c b/src/ft_damage_bad_boy.c index bf2f179..c404e94 100644 --- a/src/ft_damage_bad_boy.c +++ b/src/ft_damage_bad_boy.c @@ -48,7 +48,7 @@ void cl->sfx[13].sfx_play(cl->sfx); cl->bad_boy[id].isdead = 1; cl->mlist.map[lround(cl->sprites[13][id].s_pos_y)] - [lround(cl->sprites[13][id].s_pos_x)] = '#'; + [lround(cl->sprites[13][id].s_pos_x)] = 'x'; } else if (cl->bad_boy[id].does != 3) cl->sfx[14].sfx_play(cl->sfx); diff --git a/src/ft_draw_sprite.c b/src/ft_draw_sprite.c index 6afac08..a17ab98 100644 --- a/src/ft_draw_sprite.c +++ b/src/ft_draw_sprite.c @@ -97,10 +97,11 @@ void d = sprite->y * 256 - cl->wlist.y_size * 128 + sprite->spriteheight * 128; sprite->tex_y = ((d * cl->tlist[sprite->current_sprite].img_h / 2) / - sprite->spriteheight) / 128; - if (sprite->transformy > 0 && + sprite->spriteheight) / 128; + if ( + sprite->transformy > 0 && cl->tlist[sprite->current_sprite].ptr[sprite->tex_x * 4 + 4 * - cl->tlist[sprite->current_sprite].img_w * sprite->tex_y] + cl->tlist[sprite->current_sprite].img_w * sprite->tex_y] && cl->rlist.wall_dist_tab[sprite->x] > sprite->transformy) ft_put_sprite(sprite, cl); sprite->y++; diff --git a/src/ft_find_item.c b/src/ft_find_item.c index 394e060..6d795c3 100644 --- a/src/ft_find_item.c +++ b/src/ft_find_item.c @@ -36,7 +36,7 @@ static uint16_t uint16_t id; id = 0; - while (id <= 64) + while (id <= 32) { if (cl->sprites[10 + weap_id][id].s_pos_y == pos_y && cl->sprites[10 + weap_id][id].s_pos_x == pos_x) @@ -72,17 +72,22 @@ static void weap_id = 1; else if (map_char == '#') weap_id = 2; + else if (map_char == 'x') + weap_id = 3; cl->mlist.map[(uint64_t)pl->pos_y][(uint64_t)pl->pos_x] = '0'; - that_id = ft_fetch_weaps_id(weap_id, (uint64_t)pl->pos_y, + if (weap_id != 3) + { + that_id = ft_fetch_weaps_id(weap_id, (uint64_t)pl->pos_y, (uint64_t)pl->pos_x, cl); - cl->sprites[10 + weap_id][that_id].s_pos_x = 0; - cl->sprites[10 + weap_id][that_id].s_pos_y = 0; - pl->has_weapon[weap_id] = 1; + cl->sprites[10 + weap_id][that_id].s_pos_x = 0; + cl->sprites[10 + weap_id][that_id].s_pos_y = 0; + } + pl->has_weapon[(weap_id == 3) ? (2) : (weap_id)] = 1; pl->handles_weapon = (weap_id == 0) ? (0) : (pl->handles_weapon); pl->handles_weapon = (weap_id == 1) ? (2) : (pl->handles_weapon); pl->handles_weapon = (weap_id == 2) ? (4) : (pl->handles_weapon); - ft_set_ammo(weap_id, pl); - cl->sfx[6 + (weap_id * 2)].sfx_play(cl->sfx); + ft_set_ammo((weap_id == 3) ? (2) : (weap_id), pl); + cl->sfx[6 + (((weap_id == 3) ? (2) : (weap_id)) * 2)].sfx_play(cl->sfx); } } |