Merge pull request #2 from br69ks/master

Add falldamage scaling
This commit is contained in:
xutaxkamay 2024-07-31 23:03:22 +00:00 committed by GitHub
commit 9b270322f7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -229,6 +229,8 @@ ConVar sv_allowminmodels(
FCVAR_REPLICATED | FCVAR_NOTIFY, FCVAR_REPLICATED | FCVAR_NOTIFY,
"Allow or disallow the use of cl_minmodels on this server." ); "Allow or disallow the use of cl_minmodels on this server." );
ConVar sv_falldamage_scale("sv_falldamage_scale", "1", FCVAR_NOTIFY | FCVAR_REPLICATED);
#ifdef CLIENT_DLL #ifdef CLIENT_DLL
ConVar cl_autowepswitch( ConVar cl_autowepswitch(
@ -1624,7 +1626,7 @@ ConVar cl_autohelp(
float CCSGameRules::FlPlayerFallDamage( CBasePlayer *pPlayer ) float CCSGameRules::FlPlayerFallDamage( CBasePlayer *pPlayer )
{ {
float fFallVelocity = pPlayer->m_Local.m_flFallVelocity - CS_PLAYER_MAX_SAFE_FALL_SPEED; float fFallVelocity = pPlayer->m_Local.m_flFallVelocity - CS_PLAYER_MAX_SAFE_FALL_SPEED;
float fallDamage = fFallVelocity * CS_DAMAGE_FOR_FALL_SPEED * 1.25; float fallDamage = fFallVelocity * CS_DAMAGE_FOR_FALL_SPEED * 1.25 * sv_falldamage_scale.GetFloat();
if ( fallDamage > 0.0f ) if ( fallDamage > 0.0f )
{ {