summaryrefslogtreecommitdiffstats
path: root/src/peds/PlayerPed.cpp
diff options
context:
space:
mode:
authorerorcun <erorcunerorcun@hotmail.com.tr>2021-01-03 16:29:09 +0100
committererorcun <erorcunerorcun@hotmail.com.tr>2021-01-03 16:29:09 +0100
commit28ec412369b3f27c4e11d4ddc33c38c862686259 (patch)
tree435013d3f57ae605ac09d35d95710bbe061efc51 /src/peds/PlayerPed.cpp
parentSync miami things (diff)
downloadre3-28ec412369b3f27c4e11d4ddc33c38c862686259.tar
re3-28ec412369b3f27c4e11d4ddc33c38c862686259.tar.gz
re3-28ec412369b3f27c4e11d4ddc33c38c862686259.tar.bz2
re3-28ec412369b3f27c4e11d4ddc33c38c862686259.tar.lz
re3-28ec412369b3f27c4e11d4ddc33c38c862686259.tar.xz
re3-28ec412369b3f27c4e11d4ddc33c38c862686259.tar.zst
re3-28ec412369b3f27c4e11d4ddc33c38c862686259.zip
Diffstat (limited to 'src/peds/PlayerPed.cpp')
-rw-r--r--src/peds/PlayerPed.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/peds/PlayerPed.cpp b/src/peds/PlayerPed.cpp
index 1b5e007a..b104f14c 100644
--- a/src/peds/PlayerPed.cpp
+++ b/src/peds/PlayerPed.cpp
@@ -628,20 +628,21 @@ CPlayerPed::ProcessWeaponSwitch(CPad *padUsed)
}
}
}
+ // Out of ammo, switch to another weapon
} else if (CWeaponInfo::GetWeaponInfo((eWeaponType)m_currentWeapon)->m_eWeaponFire != WEAPON_FIRE_MELEE) {
if (GetWeapon(m_currentWeapon).m_nAmmoTotal <= 0) {
- if (TheCamera.PlayerWeaponMode.Mode != CCam::MODE_M16_1STPERSON
- && TheCamera.PlayerWeaponMode.Mode != CCam::MODE_SNIPER
- && TheCamera.PlayerWeaponMode.Mode != CCam::MODE_ROCKETLAUNCHER) {
-
- for (m_nSelectedWepSlot = m_currentWeapon - 1; m_nSelectedWepSlot >= 0; --m_nSelectedWepSlot) {
- if (m_nSelectedWepSlot == WEAPONTYPE_BASEBALLBAT && HasWeapon(WEAPONTYPE_BASEBALLBAT)
- || GetWeapon(m_nSelectedWepSlot).m_nAmmoTotal > 0 && m_nSelectedWepSlot != WEAPONTYPE_MOLOTOV && m_nSelectedWepSlot != WEAPONTYPE_GRENADE) {
- goto switchDetectDone;
- }
+ if (TheCamera.PlayerWeaponMode.Mode == CCam::MODE_M16_1STPERSON
+ || TheCamera.PlayerWeaponMode.Mode == CCam::MODE_SNIPER
+ || TheCamera.PlayerWeaponMode.Mode == CCam::MODE_ROCKETLAUNCHER)
+ return;
+
+ for (m_nSelectedWepSlot = m_currentWeapon - 1; m_nSelectedWepSlot >= 0; --m_nSelectedWepSlot) {
+ if (m_nSelectedWepSlot == WEAPONTYPE_BASEBALLBAT && HasWeapon(WEAPONTYPE_BASEBALLBAT)
+ || GetWeapon(m_nSelectedWepSlot).m_nAmmoTotal > 0 && m_nSelectedWepSlot != WEAPONTYPE_MOLOTOV && m_nSelectedWepSlot != WEAPONTYPE_GRENADE) {
+ goto switchDetectDone;
}
- m_nSelectedWepSlot = WEAPONTYPE_UNARMED;
}
+ m_nSelectedWepSlot = WEAPONTYPE_UNARMED;
}
}