From a266215e98d6a45206d18affa262040743b91161 Mon Sep 17 00:00:00 2001 From: Louis Hobbs Date: Wed, 18 Jan 2023 00:10:39 +0000 Subject: [PATCH] Decrement Weapon AmmoCount in OnFire --- Source/Nakatomi/PlayerCharacter.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/Nakatomi/PlayerCharacter.cpp b/Source/Nakatomi/PlayerCharacter.cpp index fe39991..4610d27 100644 --- a/Source/Nakatomi/PlayerCharacter.cpp +++ b/Source/Nakatomi/PlayerCharacter.cpp @@ -399,7 +399,12 @@ void APlayerCharacter::OnFire() TArray Hits = TArray(); CalculateHits(&Hits); - // TODO: Decrement ammo count + CurrentWeapon->DecrementAmmoCount(1); + + if (CurrentWeapon->GetAmmoCount() == 0) + { + RemoveCurrentWeaponFromInventory(); + } // TODO: Play sound effect