From 6d3cc55f331c813fe44c98479329902c8a94763e Mon Sep 17 00:00:00 2001 From: Andrey Akhmichin Date: Fri, 7 May 2021 03:16:55 +0500 Subject: [PATCH] Reduce max player speed. --- dlls/enginecallback.h | 1 + dlls/multiplay_gamerules.cpp | 1 + dlls/player.cpp | 1 + dlls/player.h | 1 + 4 files changed, 4 insertions(+) diff --git a/dlls/enginecallback.h b/dlls/enginecallback.h index a9e37c26..a7e6a584 100644 --- a/dlls/enginecallback.h +++ b/dlls/enginecallback.h @@ -160,5 +160,6 @@ inline void *GET_PRIVATE( edict_t *pent ) #define ENGINE_FORCE_UNMODIFIED ( *g_engfuncs.pfnForceUnmodified ) #define PLAYER_CNX_STATS ( *g_engfuncs.pfnGetPlayerStats ) +#define SET_CLIENT_MAX_SPEED ( *g_engfuncs.pfnSetClientMaxspeed ) #endif //ENGINECALLBACK_H diff --git a/dlls/multiplay_gamerules.cpp b/dlls/multiplay_gamerules.cpp index 5a4b14e0..350d9c44 100644 --- a/dlls/multiplay_gamerules.cpp +++ b/dlls/multiplay_gamerules.cpp @@ -601,6 +601,7 @@ void CHalfLifeMultiplay::PlayerSpawn( CBasePlayer *pPlayer ) pPlayer->GiveAmmo( 68, "9mm", _9MM_MAX_CARRY );// 4 full reloads } + SET_CLIENT_MAX_SPEED( edict(), PLAYER_MAX_SPEED ); pPlayer->m_iAutoWepSwitch = iOldAutoWepSwitch; } diff --git a/dlls/player.cpp b/dlls/player.cpp index 76856799..4507f288 100644 --- a/dlls/player.cpp +++ b/dlls/player.cpp @@ -2838,6 +2838,7 @@ void CBasePlayer::Spawn( void ) m_flNextChatTime = gpGlobals->time; + SET_CLIENT_MAX_SPEED( edict(), PLAYER_MAX_SPEED ); g_pGameRules->PlayerSpawn( this ); } diff --git a/dlls/player.h b/dlls/player.h index 06f29425..4644088b 100644 --- a/dlls/player.h +++ b/dlls/player.h @@ -23,6 +23,7 @@ #define DAMAGE_FOR_FALL_SPEED (float) 100 / ( PLAYER_FATAL_FALL_SPEED - PLAYER_MAX_SAFE_FALL_SPEED )// damage per unit per second. #define PLAYER_MIN_BOUNCE_SPEED 200 #define PLAYER_FALL_PUNCH_THRESHHOLD (float)350 // won't punch player's screen/make scrape noise unless player falling at least this fast. +#define PLAYER_MAX_SPEED 200 // // Player PHYSICS FLAGS bits