Fix Glock and Famas undesired ammo decreasing on burst mode (#832)

This commit is contained in:
Francisco Muñoz 2023-07-10 09:36:58 -04:00 committed by GitHub
parent 8ddda261fe
commit a5f288fbd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -761,8 +761,9 @@ void CBasePlayerWeapon::FireRemaining(int &shotsFired, float &shootTime, BOOL bI
if (bIsGlock) if (bIsGlock)
{ {
vecDir = m_pPlayer->FireBullets3(vecSrc, gpGlobals->v_forward, 0.05, 8192, 1, BULLET_PLAYER_9MM, 18, 0.9, m_pPlayer->pev, true, m_pPlayer->random_seed); vecDir = m_pPlayer->FireBullets3(vecSrc, gpGlobals->v_forward, 0.05, 8192, 1, BULLET_PLAYER_9MM, 18, 0.9, m_pPlayer->pev, true, m_pPlayer->random_seed);
#ifndef REGAMEDLL_FIXES
--m_pPlayer->ammo_9mm; --m_pPlayer->ammo_9mm;
#endif
PLAYBACK_EVENT_FULL(flag, m_pPlayer->edict(), m_usFireGlock18, 0, (float *)&g_vecZero, (float *)&g_vecZero, vecDir.x, vecDir.y, PLAYBACK_EVENT_FULL(flag, m_pPlayer->edict(), m_usFireGlock18, 0, (float *)&g_vecZero, (float *)&g_vecZero, vecDir.x, vecDir.y,
int(m_pPlayer->pev->punchangle.x * 10000), int(m_pPlayer->pev->punchangle.y * 10000), m_iClip == 0, FALSE); int(m_pPlayer->pev->punchangle.x * 10000), int(m_pPlayer->pev->punchangle.y * 10000), m_iClip == 0, FALSE);
} }
@ -770,7 +771,9 @@ void CBasePlayerWeapon::FireRemaining(int &shotsFired, float &shootTime, BOOL bI
{ {
vecDir = m_pPlayer->FireBullets3(vecSrc, gpGlobals->v_forward, m_fBurstSpread, 8192, 2, BULLET_PLAYER_556MM, 30, 0.96, m_pPlayer->pev, false, m_pPlayer->random_seed); vecDir = m_pPlayer->FireBullets3(vecSrc, gpGlobals->v_forward, m_fBurstSpread, 8192, 2, BULLET_PLAYER_556MM, 30, 0.96, m_pPlayer->pev, false, m_pPlayer->random_seed);
#ifndef REGAMEDLL_FIXES
--m_pPlayer->ammo_556nato; --m_pPlayer->ammo_556nato;
#endif
#ifdef REGAMEDLL_ADD #ifdef REGAMEDLL_ADD
// HACKHACK: client-side weapon prediction fix // HACKHACK: client-side weapon prediction fix