diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-22 19:05:12 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-22 19:05:12 +0100 |
commit | 7fbd59391bee9d23543ce933e91312e75276db8a (patch) | |
tree | 268db5130a3a62ce706cd8e222b6e47a61f2edb8 /src/ft_find_item.c | |
parent | new colors for font (diff) | |
download | 42-cub3d-7fbd59391bee9d23543ce933e91312e75276db8a.tar.gz 42-cub3d-7fbd59391bee9d23543ce933e91312e75276db8a.tar.bz2 42-cub3d-7fbd59391bee9d23543ce933e91312e75276db8a.tar.xz 42-cub3d-7fbd59391bee9d23543ce933e91312e75276db8a.tar.zst 42-cub3d-7fbd59391bee9d23543ce933e91312e75276db8a.zip |
Now regimp and sound
Diffstat (limited to 'src/ft_find_item.c')
-rw-r--r-- | src/ft_find_item.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/ft_find_item.c b/src/ft_find_item.c index 56e1351..c95fa0a 100644 --- a/src/ft_find_item.c +++ b/src/ft_find_item.c @@ -36,13 +36,23 @@ static void if (ft_ischarset(FT_CHRST_WEAPONS, map_char)) { - weap_id = (map_char == '!') ? (0) : (1); + weap_id = 0; + if (map_char == '@') + weap_id = 1; + else if (map_char == '#') + weap_id = 2; cl->mlist.map[(uint64_t)pl->pos_y][(uint64_t)pl->pos_x] = '0'; cl->weaps[weap_id][0].s_pos_x = 0; cl->weaps[weap_id][0].s_pos_y = 0; pl->has_weapon[weap_id] = 1; pl->handles_weapon = (weap_id == 1) ? (2) : (weap_id); - cl->sfx[((weap_id == 1) ? (2) : (weap_id)) + 6].sfx_play(cl->sfx); + pl->handles_weapon = (weap_id == 2) ? (4) : (weap_id); + if (weap_id == 0) + cl->sfx[6].sfx_play(cl->sfx); + else if (weap_id == 1) + cl->sfx[8].sfx_play(cl->sfx); + else if (weap_id == 2) + cl->sfx[10].sfx_play(cl->sfx); } } |