Skip to content

Commit

Permalink
port: net: carry some of the client inputs over to server-sent moves
Browse files Browse the repository at this point in the history
  • Loading branch information
fgsfdsfgs committed Dec 31, 2023
1 parent f6ee8bb commit 96e1c57
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions port/src/net/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,14 @@ static inline void netClientRecordMove(struct netclient *cl, const struct player
move->pos = (pl->prop) ? pl->prop->pos : pl->cam_pos;
move->crosspos[0] = pl->crosspos[0];
move->crosspos[1] = pl->crosspos[1];

move->ucmd = pl->ucmd;

if (g_NetMode == NETMODE_SERVER && pl->isremote && cl->inmove[0].tick) {
// carry some of the client inputs over to the outmove
move->ucmd |= (cl->inmove[0].ucmd & (UCMD_FIRE | UCMD_RELOAD | UCMD_AIMMODE | UCMD_EYESSHUT | UCMD_SELECT | UCMD_SELECT_DUAL));
}

if (pl->crouchpos == CROUCHPOS_DUCK) {
move->ucmd |= UCMD_DUCK;
} else if (pl->crouchpos == CROUCHPOS_SQUAT) {
Expand Down

0 comments on commit 96e1c57

Please sign in to comment.