diff --git a/include/client.h b/include/client.h index 654d425..5a1eaa0 100644 --- a/include/client.h +++ b/include/client.h @@ -449,6 +449,7 @@ extern kbutton_t in_strafe; extern kbutton_t in_speed; void CL_InitInput (void); +void CL_ClearStates (void); void CL_SendCmd (void); void CL_SendMove (usercmd_t *cmd); diff --git a/source/cl_input.c b/source/cl_input.c index f8c228c..83d1ce8 100644 --- a/source/cl_input.c +++ b/source/cl_input.c @@ -46,8 +46,6 @@ #include "view.h" #include "checksum.h" -/* cvar_t cl_nodelta = {"cl_nodelta","0"}; - CVAR_FIXME */ cvar_t *cl_nodelta; /* @@ -604,17 +602,26 @@ void CL_InitInput (void) Cmd_AddCommand ("+mlook", IN_MLookDown); Cmd_AddCommand ("-mlook", IN_MLookUp); -/* Cvar_RegisterVariable (&cl_nodelta); - CVAR_FIXME */ cl_nodelta = Cvar_Get("cl_nodelta", "0", CVAR_NONE, "None"); } + +extern qboolean keydown[256]; + /* ============ CL_ClearStates ============ +Generate key up event for each key that is down */ void CL_ClearStates (void) { -} + int i; +// send an up event for each key, to make sure the server clears them all + for (i=0 ; i<256 ; i++) + { + if (keydown[i]) + Key_Event (i, false); + } +} diff --git a/source/vid_mgl.c b/source/vid_mgl.c index 4ae386f..4b9921f 100644 --- a/source/vid_mgl.c +++ b/source/vid_mgl.c @@ -286,8 +286,6 @@ void VID_UpdateWindowStatus (void) } -extern qboolean keydown[256]; - /* ================ ClearAllStates @@ -295,15 +293,7 @@ ClearAllStates */ void ClearAllStates (void) { - int i; - -// send an up event for each key, to make sure the server clears them all - for (i=0 ; i<256 ; i++) - { - if (keydown[i]) - Key_Event (i, false); - } - + CL_ClearStates (); Key_ClearStates (); IN_ClearStates (); } diff --git a/source/vid_wgl.c b/source/vid_wgl.c index 94ff5ce..fc6ac4c 100644 --- a/source/vid_wgl.c +++ b/source/vid_wgl.c @@ -950,8 +950,6 @@ MAIN WINDOW =================================================================== */ -extern qboolean keydown[256]; - /* ================ ClearAllStates @@ -959,15 +957,7 @@ ClearAllStates */ void ClearAllStates (void) { - int i; - -// send an up event for each key, to make sure the server clears them all - for (i=0 ; i<256 ; i++) - { - if (keydown[i]) - Key_Event (i, false); - } - + CL_ClearStates (); Key_ClearStates (); IN_ClearStates (); }