summaryrefslogtreecommitdiffstats
path: root/src/weapons/Weapon.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/weapons/Weapon.cpp46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/weapons/Weapon.cpp b/src/weapons/Weapon.cpp
index 88c4788c..93481105 100644
--- a/src/weapons/Weapon.cpp
+++ b/src/weapons/Weapon.cpp
@@ -241,51 +241,51 @@ CWeapon::Fire(CEntity *shooter, CVector *fireSource)
}
}
- if ( fired )
+ if (fired)
{
bool isPlayer = false;
- if ( shooter->IsPed() )
+ if (shooter->IsPed())
{
- CPed *shooterPed = (CPed*)shooter;
+ CPed* shooterPed = (CPed*)shooter;
shooterPed->bIsShooting = true;
- if ( shooterPed->IsPlayer() )
+ if (shooterPed->IsPlayer())
isPlayer = true;
DMAudio.PlayOneShot(shooterPed->m_audioEntityId, SOUND_WEAPON_SHOT_FIRED, 0.0f);
}
- if ( m_nAmmoInClip > 0 ) m_nAmmoInClip--;
- if ( m_nAmmoTotal > 0 && (m_nAmmoTotal < 25000 || isPlayer) ) m_nAmmoTotal--;
+ if (m_nAmmoInClip > 0) m_nAmmoInClip--;
+ if (m_nAmmoTotal > 0 && (m_nAmmoTotal < 25000 || isPlayer)) m_nAmmoTotal--;
- if ( m_eWeaponState == WEAPONSTATE_READY && m_eWeaponType == WEAPONTYPE_FLAMETHROWER )
+ if (m_eWeaponState == WEAPONSTATE_READY && m_eWeaponType == WEAPONTYPE_FLAMETHROWER)
DMAudio.PlayOneShot(((CPhysical*)shooter)->m_audioEntityId, SOUND_WEAPON_FLAMETHROWER_FIRE, 0.0f);
m_eWeaponState = WEAPONSTATE_FIRING;
- }
- if ( m_nAmmoInClip == 0 )
- {
- if ( m_nAmmoTotal == 0 )
- return true;
+ if (m_nAmmoInClip == 0)
+ {
+ if (m_nAmmoTotal == 0)
+ return true;
- m_eWeaponState = WEAPONSTATE_RELOADING;
- m_nTimer = CTimer::GetTimeInMilliseconds() + GetInfo()->m_nReload;
+ m_eWeaponState = WEAPONSTATE_RELOADING;
+ m_nTimer = CTimer::GetTimeInMilliseconds() + GetInfo()->m_nReload;
- if ( shooter == FindPlayerPed() )
- {
- if ( CWorld::Players[CWorld::PlayerInFocus].m_bFastReload )
- m_nTimer = CTimer::GetTimeInMilliseconds() + GetInfo()->m_nReload / 4;
+ if (shooter == FindPlayerPed())
+ {
+ if (CWorld::Players[CWorld::PlayerInFocus].m_bFastReload)
+ m_nTimer = CTimer::GetTimeInMilliseconds() + GetInfo()->m_nReload / 4;
+ }
+
+ return true;
}
- return true;
+ m_nTimer = CTimer::GetTimeInMilliseconds() + 1000;
+ if (shooter == FindPlayerPed())
+ CStats::RoundsFiredByPlayer++;
}
-
- m_nTimer = CTimer::GetTimeInMilliseconds() + 1000;
- if ( shooter == FindPlayerPed() )
- CStats::RoundsFiredByPlayer++;
}
else
{