aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_find_item.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-23 16:21:36 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-23 16:21:36 +0100
commit06ce772faa11c3ef38e00b85c56b6b195bf68c56 (patch)
treec77f9aaabb0d7c433dc2006dbc4f9a31fd101327 /src/ft_find_item.c
parentIt's going well (diff)
download42-cub3d-06ce772faa11c3ef38e00b85c56b6b195bf68c56.tar.gz
42-cub3d-06ce772faa11c3ef38e00b85c56b6b195bf68c56.tar.bz2
42-cub3d-06ce772faa11c3ef38e00b85c56b6b195bf68c56.tar.xz
42-cub3d-06ce772faa11c3ef38e00b85c56b6b195bf68c56.tar.zst
42-cub3d-06ce772faa11c3ef38e00b85c56b6b195bf68c56.zip
Stuff to fix but ok
Diffstat (limited to '')
-rw-r--r--src/ft_find_item.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ft_find_item.c b/src/ft_find_item.c
index cea05fa..59b4a4f 100644
--- a/src/ft_find_item.c
+++ b/src/ft_find_item.c
@@ -35,9 +35,11 @@ static void
if (weap_id == 0)
pl->ammo[0] = FT_WEAP_ONE_STRT_AMMO;
else if (weap_id == 1)
- pl->ammo[1] = FT_WEAP_TWO_STRT_AMMO;
+ pl->ammo[1] += FT_WEAP_TWO_STRT_AMMO;
else if (weap_id == 2)
- pl->ammo[2] = FT_WEAP_THREE_STRT_AMMO;
+ pl->ammo[2] += FT_WEAP_THREE_STRT_AMMO;
+ if (pl->ammo[weap_id] > FT_WEAP_MAX_AMMO)
+ pl->ammo[weap_id] = FT_WEAP_MAX_AMMO;
}
static void