summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorerorcun <erorcunerorcun@hotmail.com.tr>2021-01-13 21:07:12 +0100
committererorcun <erorcunerorcun@hotmail.com.tr>2021-01-13 21:16:25 +0100
commita844cbbc3d1dade48a7de6112ae1a9b092d9c3e8 (patch)
tree2348a955eab5470adfd1239f36b45040404bb4d6 /src
parentMerge branch 'master' of https://github.com/GTAmodding/re3 (diff)
downloadre3-a844cbbc3d1dade48a7de6112ae1a9b092d9c3e8.tar
re3-a844cbbc3d1dade48a7de6112ae1a9b092d9c3e8.tar.gz
re3-a844cbbc3d1dade48a7de6112ae1a9b092d9c3e8.tar.bz2
re3-a844cbbc3d1dade48a7de6112ae1a9b092d9c3e8.tar.lz
re3-a844cbbc3d1dade48a7de6112ae1a9b092d9c3e8.tar.xz
re3-a844cbbc3d1dade48a7de6112ae1a9b092d9c3e8.tar.zst
re3-a844cbbc3d1dade48a7de6112ae1a9b092d9c3e8.zip
Diffstat (limited to 'src')
-rw-r--r--src/render/Hud.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/render/Hud.cpp b/src/render/Hud.cpp
index ae7b7eb3..b718c163 100644
--- a/src/render/Hud.cpp
+++ b/src/render/Hud.cpp
@@ -509,10 +509,10 @@ void CHud::Draw()
/*
DrawAmmo
*/
- uint32 AmmoAmount = CWeaponInfo::GetWeaponInfo(FindPlayerPed()->GetWeapon()->m_eWeaponType)->m_nAmountofAmmunition;
- uint32 AmmoInClip = FindPlayerPed()->m_weapons[FindPlayerPed()->m_currentWeapon].m_nAmmoInClip;
- uint32 TotalAmmo = FindPlayerPed()->m_weapons[FindPlayerPed()->m_currentWeapon].m_nAmmoTotal;
- uint32 Ammo, Clip;
+ int32 AmmoAmount = CWeaponInfo::GetWeaponInfo(FindPlayerPed()->GetWeapon()->m_eWeaponType)->m_nAmountofAmmunition;
+ int32 AmmoInClip = FindPlayerPed()->m_weapons[FindPlayerPed()->m_currentWeapon].m_nAmmoInClip;
+ int32 TotalAmmo = FindPlayerPed()->m_weapons[FindPlayerPed()->m_currentWeapon].m_nAmmoTotal;
+ int32 Ammo, Clip;
if (AmmoAmount <= 1 || AmmoAmount >= 1000)
sprintf(sTemp, "%d", TotalAmmo);
@@ -520,18 +520,12 @@ void CHud::Draw()
if (WeaponType == WEAPONTYPE_FLAMETHROWER) {
Clip = AmmoInClip / 10;
- if ((TotalAmmo - AmmoInClip) / 10 <= 9999)
- Ammo = (TotalAmmo - AmmoInClip) / 10;
- else
- Ammo = 9999;
+ Ammo = Min((TotalAmmo - AmmoInClip) / 10, 9999);
}
else {
Clip = AmmoInClip;
- if ((TotalAmmo - AmmoInClip) > 9999)
- Ammo = 9999;
- else
- Ammo = TotalAmmo - AmmoInClip;
+ Ammo = Min(TotalAmmo - AmmoInClip, 9999);
}
sprintf(sTemp, "%d-%d", Ammo, Clip);