]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
cbuf: fix a 1 frame delay of keybind inputs
authorbones_was_here <bones_was_here@xonotic.au>
Mon, 25 Sep 2023 06:08:42 +0000 (16:08 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Tue, 26 Sep 2023 04:40:25 +0000 (14:40 +1000)
This was a regression (from div0-stable) introduced in the refactoring.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
cl_main.c
host.c

index fe1840aff42db97cb43db2ec931f381da739312b..9418ee06f7dd5811921a3dd57a2c92b691cf767e 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -2813,11 +2813,6 @@ double CL_Frame (double time)
 
        CL_VM_PreventInformationLeaks();
 
-       // get new key events
-       Key_EventQueue_Unblock();
-       SndSys_SendKeyEvents();
-       Sys_SendKeyEvents();
-
        /*
         * If the accumulator hasn't become positive, don't
         * run the frame. Everything that happens before this
diff --git a/host.c b/host.c
index 0957102430ff74c1a078b87acd3096b256698222..a20903a9823c7d156920999aac66077ac778bbf1 100644 (file)
--- a/host.c
+++ b/host.c
@@ -643,6 +643,9 @@ static double Host_Frame(double time)
        // Run any downloads
        Curl_Frame();
 
+       // get new SDL events and add commands from keybindings to the cbuf
+       Sys_SendKeyEvents();
+
        // process console commands
        Cbuf_Frame(host.cbuf);