aboutsummaryrefslogtreecommitdiff
path: root/mp/src/game/server/player_command.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mp/src/game/server/player_command.cpp')
-rw-r--r--mp/src/game/server/player_command.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/mp/src/game/server/player_command.cpp b/mp/src/game/server/player_command.cpp
index b607bbab..bf77b5d4 100644
--- a/mp/src/game/server/player_command.cpp
+++ b/mp/src/game/server/player_command.cpp
@@ -23,6 +23,7 @@ extern CMoveData *g_pMoveData; // This is a global because it is subclassed by e
extern ConVar sv_noclipduringpause;
ConVar sv_maxusrcmdprocessticks_warning( "sv_maxusrcmdprocessticks_warning", "-1", FCVAR_NONE, "Print a warning when user commands get dropped due to insufficient usrcmd ticks allocated, number of seconds to throttle, negative disabled" );
+static ConVar sv_maxusrcmdprocessticks_holdaim( "sv_maxusrcmdprocessticks_holdaim", "1", FCVAR_CHEAT, "Hold client aim for multiple server sim ticks when client-issued usrcmd contains multiple actions (0: off; 1: hold this server tick; 2+: hold multiple ticks)" );
//-----------------------------------------------------------------------------
// Purpose:
@@ -442,6 +443,12 @@ void CPlayerMove::RunCommand ( CBasePlayer *player, CUserCmd *ucmd, IMoveHelper
// Copy output
FinishMove( player, ucmd, g_pMoveData );
+ // If we have to restore the view angle then do so right now
+ if ( !player->IsBot() && ( gpGlobals->tickcount - player->GetLockViewanglesTickNumber() < sv_maxusrcmdprocessticks_holdaim.GetInt() ) )
+ {
+ player->pl.v_angle = player->GetLockViewanglesData();
+ }
+
// Let server invoke any needed impact functions
VPROF_SCOPE_BEGIN( "moveHelper->ProcessImpacts" );
moveHelper->ProcessImpacts();