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.