From 866be28da0bd70d32031a369e6ac62f1a5473d2e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 15 Jul 2020 09:21:47 +0200 Subject: [PATCH] - clear the input state when starting a new map or loading a savegame. --- source/build/src/engine.cpp | 1 + source/core/menu/menu.cpp | 1 + source/games/duke/src/d_menu.cpp | 3 --- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index 66f333b6b..00b50d430 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -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; diff --git a/source/core/menu/menu.cpp b/source/core/menu/menu.cpp index 56aeeb872..340287cb3 100644 --- a/source/core/menu/menu.cpp +++ b/source/core/menu/menu.cpp @@ -964,6 +964,7 @@ void M_ClearMenus (bool final) CurrentMenu = nullptr; menuactive = MENU_Off; M_UnpauseSound(); + inputState.ClearAllInput(); if (!final) { gi->MenuClosed(); diff --git a/source/games/duke/src/d_menu.cpp b/source/games/duke/src/d_menu.cpp index 515a4f565..b7a8064bd 100644 --- a/source/games/duke/src/d_menu.cpp +++ b/source/games/duke/src/d_menu.cpp @@ -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;