Fix mismatched damage glock18 in burst mode 18 against 25 (GLOCK18_DAMAGE)

This commit is contained in:
s1lentq 2024-01-19 20:33:01 +07:00
parent 051dc0751a
commit 4b49f630da

View File

@ -767,9 +767,15 @@ void CBasePlayerWeapon::FireRemaining(int &shotsFired, float &shootTime, BOOL bI
flag = 0; flag = 0;
#endif #endif
#ifdef REGAMEDLL_API
float flBaseDamage = CSPlayerWeapon()->m_flBaseDamage;
#else
float flBaseDamage = bIsGlock ? GLOCK18_DAMAGE : FAMAS_DAMAGE;
#endif
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, flBaseDamage, 0.9, m_pPlayer->pev, true, m_pPlayer->random_seed);
#ifndef REGAMEDLL_FIXES #ifndef REGAMEDLL_FIXES
--m_pPlayer->ammo_9mm; --m_pPlayer->ammo_9mm;
#endif #endif
@ -778,8 +784,7 @@ void CBasePlayerWeapon::FireRemaining(int &shotsFired, float &shootTime, BOOL bI
} }
else else
{ {
vecDir = m_pPlayer->FireBullets3(vecSrc, gpGlobals->v_forward, m_fBurstSpread, 8192, 2, BULLET_PLAYER_556MM, flBaseDamage, 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 #ifndef REGAMEDLL_FIXES
--m_pPlayer->ammo_556nato; --m_pPlayer->ammo_556nato;
#endif #endif