diff --git a/src/engine/client/cl_cgame.cpp b/src/engine/client/cl_cgame.cpp index d716c90b0b..51875f0ba4 100644 --- a/src/engine/client/cl_cgame.cpp +++ b/src/engine/client/cl_cgame.cpp @@ -137,7 +137,8 @@ void CL_ConfigstringModified( Cmd::Args& csCmd ) /* =================== CL_HandleServerCommand -CL_GetServerCommand + +Returns true if the command should be passed to the cgame =================== */ bool CL_HandleServerCommand(Str::StringRef text, std::string& newText) { @@ -255,13 +256,6 @@ void CL_FillServerCommands(std::vector& commands, int start, int en // if we have irretrievably lost a reliable command, drop the connection if ( start <= clc.serverCommandSequence - MAX_RELIABLE_COMMANDS ) { - // when a demo record was started after the client got a whole bunch of - // reliable commands then the client never got those first reliable commands - if ( clc.demoplaying ) - { - return; - } - Sys::Drop( "CL_FillServerCommand: a reliable command was cycled out" ); } diff --git a/src/engine/client/cl_parse.cpp b/src/engine/client/cl_parse.cpp index 2169c114fd..45e8bfad66 100644 --- a/src/engine/client/cl_parse.cpp +++ b/src/engine/client/cl_parse.cpp @@ -408,7 +408,14 @@ void CL_ParseGamestate( msg_t *msg ) CL_ClearState(); // a gamestate always marks a server command sequence - clc.serverCommandSequence = MSG_ReadLong( msg ); + int commandNum = MSG_ReadLong( msg ); + + if ( commandNum < clc.serverCommandSequence ) + { + Sys::Drop( "Gamestate moved serverCommandSequence backward" ); + } + + clc.serverCommandSequence = commandNum; // trash any commands from previous game clc.lastExecutedServerCommand = clc.serverCommandSequence; @@ -499,6 +506,13 @@ void CL_ParseCommandString( msg_t *msg ) return; } + if ( clc.serverCommandSequence + 1 != seq ) + { + Sys::Drop( "Out-of-sequence server command: expected %d, got %d", + clc.serverCommandSequence + 1, seq ); + return; + } + clc.serverCommandSequence = seq; index = seq & ( MAX_RELIABLE_COMMANDS - 1 );