summaryrefslogtreecommitdiffstats
path: root/src/control/Pickups.cpp
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-11-25 18:39:57 +0100
committerSergeanur <s.anureev@yandex.ua>2020-11-25 18:39:57 +0100
commit164f16c85b73176a6f2baf1e70e8ee8c575eb835 (patch)
tree586abc75cbc07f0cafe22e0b5d63fd18d2fd61e3 /src/control/Pickups.cpp
parentOriginal enum name (diff)
downloadre3-164f16c85b73176a6f2baf1e70e8ee8c575eb835.tar
re3-164f16c85b73176a6f2baf1e70e8ee8c575eb835.tar.gz
re3-164f16c85b73176a6f2baf1e70e8ee8c575eb835.tar.bz2
re3-164f16c85b73176a6f2baf1e70e8ee8c575eb835.tar.lz
re3-164f16c85b73176a6f2baf1e70e8ee8c575eb835.tar.xz
re3-164f16c85b73176a6f2baf1e70e8ee8c575eb835.tar.zst
re3-164f16c85b73176a6f2baf1e70e8ee8c575eb835.zip
Diffstat (limited to 'src/control/Pickups.cpp')
-rw-r--r--src/control/Pickups.cpp14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/control/Pickups.cpp b/src/control/Pickups.cpp
index 336ad83c..4d325101 100644
--- a/src/control/Pickups.cpp
+++ b/src/control/Pickups.cpp
@@ -140,18 +140,12 @@ ModifyStringLabelForControlSetting(char *str)
}
}
-inline bool
-IsWeaponSlotAmmoMergeable(uint32 slot)
-{
- return slot == WEAPONSLOT_SHOTGUN || slot == WEAPONSLOT_SUBMACHINEGUN || slot == WEAPONSLOT_RIFLE;
-}
-
void
CPickup::ExtractAmmoFromPickup(CPlayerPed *player)
{
eWeaponType weaponType = CPickups::WeaponForModel(m_pObject->GetModelIndex());
- if (m_eType == PICKUP_IN_SHOP || !IsWeaponSlotAmmoMergeable(CWeaponInfo::GetWeaponInfo(weaponType)->m_nWeaponSlot))
+ if (m_eType == PICKUP_IN_SHOP || !CWeaponInfo::IsWeaponSlotAmmoMergeable(CWeaponInfo::GetWeaponInfo(weaponType)->m_nWeaponSlot))
return;
uint32 ammo = m_nQuantity;
@@ -374,14 +368,14 @@ CPickup::Update(CPlayerPed *player, CVehicle *vehicle, int playerId)
eWeaponType plrWeaponSlot = FindPlayerPed()->GetWeapon(slot).m_eWeaponType;
if (plrWeaponSlot != weaponType) {
if (CStreaming::ms_aInfoForModel[m_pObject->GetModelIndex()].m_loadState == STREAMSTATE_LOADED) {
- if (plrWeaponSlot == WEAPONTYPE_UNARMED || (FindPlayerPed()->GetWeapon(slot).m_nAmmoTotal == 0 && !IsWeaponSlotAmmoMergeable(slot))) {
+ if (plrWeaponSlot == WEAPONTYPE_UNARMED || (FindPlayerPed()->GetWeapon(slot).m_nAmmoTotal == 0 && !CWeaponInfo::IsWeaponSlotAmmoMergeable(slot))) {
if (CTimer::GetTimeInMilliseconds() - FindPlayerPed()->m_nPadDownPressedInMilliseconds < 1500) {
CPickups::PlayerOnWeaponPickup = 6;
isPickupTouched = false;
}
} else {
CPickups::PlayerOnWeaponPickup = 6;
- if (IsWeaponSlotAmmoMergeable(slot)) {
+ if (CWeaponInfo::IsWeaponSlotAmmoMergeable(slot)) {
if (m_eType == PICKUP_ONCE_TIMEOUT || m_eType == PICKUP_ONCE || m_eType == PICKUP_ON_STREET) {
ExtractAmmoFromPickup(player);
FindPlayerPed()->GetWeapon(slot).Reload();
@@ -1384,7 +1378,7 @@ void
CPickups::RemoveAllPickupsOfACertainWeaponGroupWithNoAmmo(eWeaponType weaponType)
{
uint32 weaponSlot = CWeaponInfo::GetWeaponInfo(weaponType)->m_nWeaponSlot;
- if (IsWeaponSlotAmmoMergeable(weaponSlot)) {
+ if (CWeaponInfo::IsWeaponSlotAmmoMergeable(weaponSlot)) {
for (int slot = 0; slot < NUMPICKUPS; slot++) {
if (aPickUps[slot].m_eType == PICKUP_ONCE || aPickUps[slot].m_eType == PICKUP_ONCE_TIMEOUT || aPickUps[slot].m_eType == PICKUP_ONCE_TIMEOUT_SLOW) {
if (aPickUps[slot].m_pObject) {