diff options
author | erorcun <erayorcunus@gmail.com> | 2020-01-12 00:11:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-12 00:11:09 +0100 |
commit | ea90290e07e21b132f7a50c42a97e30a6a2eb803 (patch) | |
tree | 184d9cc8481624d34156bfef3f6b44c5241b1e8b /src/peds/PlayerPed.cpp | |
parent | Merge pull request #289 from erorcun/erorcun (diff) | |
parent | Fixes 2 (diff) | |
download | re3-ea90290e07e21b132f7a50c42a97e30a6a2eb803.tar re3-ea90290e07e21b132f7a50c42a97e30a6a2eb803.tar.gz re3-ea90290e07e21b132f7a50c42a97e30a6a2eb803.tar.bz2 re3-ea90290e07e21b132f7a50c42a97e30a6a2eb803.tar.lz re3-ea90290e07e21b132f7a50c42a97e30a6a2eb803.tar.xz re3-ea90290e07e21b132f7a50c42a97e30a6a2eb803.tar.zst re3-ea90290e07e21b132f7a50c42a97e30a6a2eb803.zip |
Diffstat (limited to 'src/peds/PlayerPed.cpp')
-rw-r--r-- | src/peds/PlayerPed.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/peds/PlayerPed.cpp b/src/peds/PlayerPed.cpp index df234bfb..8892fc2a 100644 --- a/src/peds/PlayerPed.cpp +++ b/src/peds/PlayerPed.cpp @@ -573,8 +573,6 @@ CPlayerPed::ProcessWeaponSwitch(CPad *padUsed) if (CDarkel::FrenzyOnGoing())
goto switchDetectDone;
- // The fact that m_nSelectedWepSlot is int8 makes below loops circular loop.
-
if (padUsed->CycleWeaponRightJustDown() && !m_pPointGunAt) {
if (TheCamera.PlayerWeaponMode.Mode != CCam::MODE_M16_1STPERSON
@@ -596,12 +594,14 @@ CPlayerPed::ProcessWeaponSwitch(CPad *padUsed) && TheCamera.PlayerWeaponMode.Mode != CCam::MODE_SNIPER
&& TheCamera.PlayerWeaponMode.Mode != CCam::MODE_ROCKETLAUNCHER) {
- for (m_nSelectedWepSlot = m_currentWeapon - 1; m_nSelectedWepSlot >= 0; --m_nSelectedWepSlot) {
+ for (m_nSelectedWepSlot = m_currentWeapon - 1; ; --m_nSelectedWepSlot) {
+ if (m_nSelectedWepSlot < WEAPONTYPE_UNARMED)
+ m_nSelectedWepSlot = WEAPONTYPE_DETONATOR;
+
if (HasWeapon(m_nSelectedWepSlot) && GetWeapon(m_nSelectedWepSlot).HasWeaponAmmoToBeUsed()) {
goto switchDetectDone;
}
}
- m_nSelectedWepSlot = WEAPONTYPE_DETONATOR;
}
} else if (CWeaponInfo::GetWeaponInfo((eWeaponType)m_currentWeapon)->m_eWeaponFire != WEAPON_FIRE_MELEE) {
if (GetWeapon(m_currentWeapon).m_nAmmoTotal <= 0) {
|