From eeed4b8ada6b18a4863467656a5c4c8b5c490c8d Mon Sep 17 00:00:00 2001 From: Kamay Xutax Date: Sat, 7 Sep 2024 05:33:20 +0200 Subject: [PATCH] Adjusted some values for m82a1 --- .gitignore | 86 ++++++++++++++++------------ game/shared/cstrike/weapon_m82a1.cpp | 33 ++++++----- 2 files changed, 66 insertions(+), 53 deletions(-) mode change 100644 => 100755 .gitignore diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 index 3ef27d03f7..d01d1023ec --- a/.gitignore +++ b/.gitignore @@ -1,38 +1,48 @@ -*.mak -*.mak.vpc_crc -*.vpc_crc -*.vpc.* -*.project -*obj_* -.waf* -.lock-waf* -__pycache__ -*.pyc -.vs/ -Debug/ -Debug_*/ -Release/ -Release_*/ -*.tlog/ -*.obj -*.pch -*.log -*.idb -*.pdb -*.rc -*.vcxproj* -*.sln -*.dll* -*.exp -*.ilk -ValveETWProviderEvents.h -game/client/*/client.lib -game/server/*/server.lib -.DS_Store -build*/ -.cache/ -.ccache/ -waf3*/ -.vscode/ -.depproj/ -source-engine.sln +*.mak +*.mak.vpc_crc +*.vpc_crc +*.vpc.* +*.project +*obj_* +.waf* +.lock-waf* +__pycache__ +*.pyc +.vs/ +Debug/ +Debug_*/ +Release/ +Release_*/ +*.tlog/ +*.obj +*.pch +*.log +*.idb +*.pdb +*.rc +*.vcxproj* +*.sln +*.dll* +*.exp +*.exe +*.ilk +ValveETWProviderEvents.h +game/client/*/client.lib +game/server/*/server.lib +.DS_Store +build*/ +.cache/ +.ccache/ +waf3*/ +.vscode/ +.depproj/ +source-engine.sln +gamedata/css_enhanced/game/cstrike/cfg/config.cfg +gamedata/css_enhanced/game/bin/*.lib +gamedata/css_enhanced/game/cstrike/bin/*.lib +gamedata/css_enhanced/game/cstrike/downladlists/* +gamedata/css_enhanced/game/cstrike/download/* +*.cache +*.tmp +*.lst +gamedata/css_enhanced/game/cstrike/textwindow_temp.html \ No newline at end of file diff --git a/game/shared/cstrike/weapon_m82a1.cpp b/game/shared/cstrike/weapon_m82a1.cpp index 6129715eb0..b518794c85 100644 --- a/game/shared/cstrike/weapon_m82a1.cpp +++ b/game/shared/cstrike/weapon_m82a1.cpp @@ -110,7 +110,7 @@ void CWeaponM82A1::Spawn() void CWeaponM82A1::SecondaryAttack() { - const float kZoomTime = 0.2f; + static constexpr float kZoomTime = 0.2f; CCSPlayer *pPlayer = GetPlayerOwner(); @@ -122,27 +122,27 @@ void CWeaponM82A1::SecondaryAttack() if ( pPlayer->GetFOV() == pPlayer->GetDefaultFOV() ) { - pPlayer->SetFOV( pPlayer, FOVValues[FOV_SCOPE_1], kZoomTime ); - m_weaponMode = Secondary_Mode; - m_fAccuracyPenalty += GetCSWpnData().m_fInaccuracyAltSwitch; + m_iLastZoom = FOVValues[FOV_SCOPE_1]; + m_weaponMode = Secondary_Mode; + m_fAccuracyPenalty += GetCSWpnData().m_fInaccuracyAltSwitch; } else if ( pPlayer->GetFOV() == FOVValues[FOV_SCOPE_1] ) { - pPlayer->SetFOV( pPlayer, FOVValues[FOV_SCOPE_2], kZoomTime ); - m_weaponMode = Secondary_Mode; + m_iLastZoom = FOVValues[FOV_SCOPE_2]; + m_weaponMode = Secondary_Mode; } else if ( pPlayer->GetFOV() == FOVValues[FOV_SCOPE_2] ) { - pPlayer->SetFOV( pPlayer, FOVValues[FOV_SCOPE_3], kZoomTime ); - m_weaponMode = Secondary_Mode; + m_iLastZoom = FOVValues[FOV_SCOPE_3]; + m_weaponMode = Secondary_Mode; } else { - pPlayer->SetFOV( pPlayer, pPlayer->GetDefaultFOV(), kZoomTime ); + m_iLastZoom = pPlayer->GetDefaultFOV(); m_weaponMode = Primary_Mode; } - m_iLastZoom = pPlayer->GetFOV(); + pPlayer->SetFOV( pPlayer, m_iLastZoom, kZoomTime ); #ifndef CLIENT_DLL // If this isn't guarded, the sound will be emitted twice, once by the server and once by the client. @@ -170,7 +170,7 @@ void CWeaponM82A1::SecondaryAttack() #endif m_flNextSecondaryAttack = gpGlobals->curtime + 0.4f; - m_zoomFullyActiveTime = gpGlobals->curtime + 0.2f; + m_zoomFullyActiveTime = gpGlobals->curtime + kZoomTime; } @@ -229,10 +229,13 @@ void CWeaponM82A1::PrimaryAttack() #endif } - QAngle angle = pPlayer->GetPunchAngle(); RandomSeed( pPlayer->GetPredictionRandomSeed() ); - angle.x -= 15 + RandomFloat( 2, 8 ); - angle.y -= static_cast< float >( RandomInt( -1, 1 ) ) * RandomFloat( 2, 4 ); + + QAngle angle = pPlayer->GetPunchAngle(); + + angle.x -= 15 + RandomFloat( 5, 10 ); + angle.y -= static_cast< float >( RandomInt( -1, 1 ) ) * RandomFloat( 2, 5 ); + pPlayer->SetPunchAngle( angle ); } @@ -269,7 +272,7 @@ float CWeaponM82A1::GetMaxSpeed() const else { // Slower speed when zoomed in. - return 100; + return 90; } }