Skip to content

Commit

Permalink
Fix CPed::GrantAmmo (#576)
Browse files Browse the repository at this point in the history
  • Loading branch information
yukani authored Jul 12, 2023
1 parent b6e9ffa commit 2e49955
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/game_sa/Entity/Ped/Ped.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,7 @@ void CPed::GrantAmmo(eWeaponType weaponType, uint32 ammo) {
if (wepSlot != -1) {
auto& wepInSlot = GetWeaponInSlot(wepSlot);

wepInSlot.m_nTotalAmmo = std::min(ammo, 99'999u); // Clamp upper
wepInSlot.m_nTotalAmmo = std::min(wepInSlot.m_nTotalAmmo + ammo, 99'999u); // Clamp upper

// TODO: Inlined
if (wepInSlot.m_nState == WEAPONSTATE_OUT_OF_AMMO) {
Expand Down

0 comments on commit 2e49955

Please sign in to comment.