Skip to content

Commit

Permalink
engine: server: do not continue processing command if the player was …
Browse files Browse the repository at this point in the history
…kicked during it (for example, by speedhack prevention)
  • Loading branch information
a1batross committed Mar 1, 2025
1 parent 7222830 commit 29c8818
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions engine/server/sv_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -3328,6 +3328,10 @@ static void SV_ParseClientMove( sv_client_t *cl, sizebuf_t *msg )
SV_RunCmd( cl, &cmds[i], cl->netchan.incoming_sequence - i );
}

// was player kicked? stop here
if( cl->state <= cs_zombie )
return;

cl->lastcmd = cmds[0];

// adjust latency time by 1/2 last client frame since
Expand Down
4 changes: 4 additions & 0 deletions engine/server/sv_pmove.c
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,10 @@ void SV_RunCmd( sv_client_t *cl, usercmd_t *ucmd, int random_seed )
vec3_t oldvel;
usercmd_t cmd;

// if the player got kicked, do not process commands
if( cl->state <= cs_zombie )
return;

clent = cl->edict;
cmd = *ucmd;

Expand Down

0 comments on commit 29c8818

Please # to comment.