mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-02-04 17:50:45 +03:00
Fix "use accuracy from last bullet fired earlier" glitch. (#662)
* Fixes "use accuracy from last bullet fired earlier" glitch. * fix newline at wapons.h Co-authored-by: Sergey Shorokhov <wopox1337@ya.ru>
This commit is contained in:
parent
38dda25a84
commit
67cc153f5d
@ -49,6 +49,29 @@ int MaxAmmoCarry(WeaponIdType weaponId)
|
|||||||
return CBasePlayerItem::m_ItemInfoArray[weaponId].iMaxAmmo1;
|
return CBasePlayerItem::m_ItemInfoArray[weaponId].iMaxAmmo1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// All automatic weapons are represented here
|
||||||
|
float GetBaseAccuracy(WeaponIdType id)
|
||||||
|
{
|
||||||
|
switch (id)
|
||||||
|
{
|
||||||
|
case WEAPON_M4A1:
|
||||||
|
case WEAPON_AK47:
|
||||||
|
case WEAPON_AUG:
|
||||||
|
case WEAPON_SG552:
|
||||||
|
case WEAPON_FAMAS:
|
||||||
|
case WEAPON_GALIL:
|
||||||
|
case WEAPON_M249:
|
||||||
|
case WEAPON_P90:
|
||||||
|
case WEAPON_TMP:
|
||||||
|
return 0.2f;
|
||||||
|
case WEAPON_MAC10:
|
||||||
|
return 0.15f;
|
||||||
|
case WEAPON_UMP45:
|
||||||
|
case WEAPON_MP5N:
|
||||||
|
return 0.0f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Resets the global multi damage accumulator
|
// Resets the global multi damage accumulator
|
||||||
void ClearMultiDamage()
|
void ClearMultiDamage()
|
||||||
{
|
{
|
||||||
@ -1024,6 +1047,14 @@ void CBasePlayerWeapon::ItemPostFrame()
|
|||||||
{
|
{
|
||||||
m_flDecreaseShotsFired = gpGlobals->time + 0.0225f;
|
m_flDecreaseShotsFired = gpGlobals->time + 0.0225f;
|
||||||
m_iShotsFired--;
|
m_iShotsFired--;
|
||||||
|
|
||||||
|
#ifdef REGAMEDLL_FIXES
|
||||||
|
// Reset accuracy
|
||||||
|
if (m_iShotsFired == 0)
|
||||||
|
{
|
||||||
|
m_flAccuracy = GetBaseAccuracy((WeaponIdType)m_iId);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2056,3 +2056,4 @@ void EjectBrass2(const Vector &vecOrigin, const Vector &vecVelocity, float rotat
|
|||||||
void AddAmmoNameToAmmoRegistry(const char *szAmmoname);
|
void AddAmmoNameToAmmoRegistry(const char *szAmmoname);
|
||||||
void UTIL_PrecacheOtherWeapon(const char *szClassname);
|
void UTIL_PrecacheOtherWeapon(const char *szClassname);
|
||||||
BOOL CanAttack(float attack_time, float curtime, BOOL isPredicted);
|
BOOL CanAttack(float attack_time, float curtime, BOOL isPredicted);
|
||||||
|
float GetBaseAccuracy(WeaponIdType id);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user