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...

This commit is contained in:
toaster 2022-04-01 20:54:15 +01:00
parent ff5992e3c4
commit 8b88284b32

View file

@ -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.