From 0ff845620b0f1bd47a49a2fc1cd0daa4a24442a7 Mon Sep 17 00:00:00 2001 From: s1lent Date: Wed, 15 Jan 2020 20:28:52 +0700 Subject: [PATCH] USP: Fixed jitter effect when playing an animation of adding a silencer. --- regamedll/dlls/weapons.h | 16 +++++++++++----- regamedll/dlls/wpn_shared/wpn_usp.cpp | 4 ++-- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/regamedll/dlls/weapons.h b/regamedll/dlls/weapons.h index f3d90ebb..85948491 100644 --- a/regamedll/dlls/weapons.h +++ b/regamedll/dlls/weapons.h @@ -493,11 +493,17 @@ public: }; -const float USP_MAX_SPEED = 250.0f; -const float USP_DAMAGE = 34.0f; -const float USP_DAMAGE_SIL = 30.0f; -const float USP_RANGE_MODIFER = 0.79f; -const float USP_RELOAD_TIME = 2.7f; +const float USP_MAX_SPEED = 250.0f; +const float USP_DAMAGE = 34.0f; +const float USP_DAMAGE_SIL = 30.0f; +const float USP_RANGE_MODIFER = 0.79f; +const float USP_RELOAD_TIME = 2.7f; + +#ifdef REGAMEDLL_FIXES +const float USP_ADJUST_SIL_TIME = 3.13f; +#else +const float USP_ADJUST_SIL_TIME = 3.0f; +#endif enum usp_e { diff --git a/regamedll/dlls/wpn_shared/wpn_usp.cpp b/regamedll/dlls/wpn_shared/wpn_usp.cpp index da8b58bc..6141baeb 100644 --- a/regamedll/dlls/wpn_shared/wpn_usp.cpp +++ b/regamedll/dlls/wpn_shared/wpn_usp.cpp @@ -108,8 +108,8 @@ void CUSP::SecondaryAttack() Q_strcpy(m_pPlayer->m_szAnimExtention, "onehanded"); } - m_flNextSecondaryAttack = m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + 3.0f; - m_flNextPrimaryAttack = GetNextAttackDelay(3.0); + m_flNextSecondaryAttack = m_flTimeWeaponIdle = UTIL_WeaponTimeBase() + USP_ADJUST_SIL_TIME; + m_flNextPrimaryAttack = GetNextAttackDelay(USP_ADJUST_SIL_TIME); } void CUSP::PrimaryAttack()