Skip to content

Commit f1ec894

Browse files
committed
fix sticky keys in spec/demo playback for movement keys overlay
1 parent 5dfb169 commit f1ec894

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

codemp/cgame/hud_strafehelper.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -584,9 +584,9 @@ int DF_SetPlayerState(centity_t* cent)
584584
void DF_SetClientCmd(centity_t* cent) {
585585
state.moveDir = cg.snap->ps.movementDir;
586586
state.cmd = DF_DirToCmd(state.moveDir);
587-
if (cg.snap->ps.pm_flags & PMF_JUMP_HELD) {
588-
state.cmd.upmove = 127;
589-
}
587+
state.cmd.upmove = 0;
588+
state.cmd.buttons &= ~(BUTTON_ATTACK | BUTTON_ALT_ATTACK);
589+
590590
if ((DF_GetGroundDistance() > 1 && state.velocity[2] > 8 && state.velocity[2] > cg.lastZSpeed && !cg.snap->ps.fd.forceGripCripple) || (cg.snap->ps.pm_flags & PMF_JUMP_HELD))
591591
state.cmd.upmove = 1;
592592
else if ((cg.snap->ps.pm_flags & PMF_DUCKED) || CG_InRollAnim(cent))
@@ -822,7 +822,8 @@ usercmd_t DF_DirToCmd(int moveDir) {
822822
outCmd.rightmove = 127;
823823
break;
824824
default:
825-
break;
825+
outCmd.forwardmove = 0;
826+
outCmd.rightmove = 0;
826827
}
827828
return outCmd;
828829
}

0 commit comments

Comments
 (0)