- clear the input state when starting a new map or loading a savegame.

This commit is contained in:
Christoph Oelckers 2020-07-15 09:21:47 +02:00
parent 99161e2e4a
commit 866be28da0
3 changed files with 2 additions and 3 deletions

View file

@ -2611,6 +2611,7 @@ int32_t(*loadboard_replace)(const char *filename, char flags, vec3_t *dapos, int
// <= -4: map-text error
int32_t engineLoadBoard(const char *filename, char flags, vec3_t *dapos, int16_t *daang, int16_t *dacursectnum)
{
inputState.ClearAllInput();
if (loadboard_replace)
return loadboard_replace(filename, flags, dapos, daang, dacursectnum);
int32_t i;

View file

@ -964,6 +964,7 @@ void M_ClearMenus (bool final)
CurrentMenu = nullptr;
menuactive = MENU_Off;
M_UnpauseSound();
inputState.ClearAllInput();
if (!final)
{
gi->MenuClosed();

View file

@ -261,9 +261,6 @@ void GameInterface::MenuClosed()
auto& gm = ps[myconnectindex].gm;
if (gm & MODE_GAME)
{
if (gm & MODE_MENU)
inputState.ClearAllInput();
// The following lines are here so that you cannot close the menu when no game is running.
gm &= ~MODE_MENU;