From 8b88284b329302faf4a29e3ace30cb2a2ea9d63a Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 1 Apr 2022 20:54:15 +0100 Subject: [PATCH] Fix in-game ticcmds being generated with your inputs while a menu is supposed to be eating them. (we can no longer rely on the ev_ system eating them before they get processed, so just add extra exceptions... --- src/g_game.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 5f7b0cd73..ed2998f25 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -870,6 +870,20 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer) return; } + cmd->flags = 0; + + if (menuactive || chat_on || CON_Ready()) + { + cmd->flags |= TICCMD_TYPING; + + if (hu_keystrokes) + { + cmd->flags |= TICCMD_KEYSTROKE; + } + + goto aftercmdinput; + } + if (K_PlayerUsesBotMovement(player)) { // Bot ticcmd is generated by K_BuildBotTiccmd @@ -1017,17 +1031,8 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer) */ cmd->forwardmove += (SINT8)forward; - cmd->flags = 0; - if (chat_on || CON_Ready()) - { - cmd->flags |= TICCMD_TYPING; - - if (hu_keystrokes) - { - cmd->flags |= TICCMD_KEYSTROKE; - } - } +aftercmdinput: /* Lua: Allow this hook to overwrite ticcmd. We check if we're actually in a level because for some reason this Hook would run in menus and on the titlescreen otherwise.