Clear input on menu open/close (#1462)

This commit is contained in:
ceski 2024-02-11 00:55:33 -08:00 committed by GitHub
parent f3439f70e2
commit 9c21ed7669
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 16 additions and 6 deletions

View File

@ -841,6 +841,16 @@ void G_BuildTiccmd(ticcmd_t* cmd)
}
}
void G_ClearInput(void)
{
I_ResetControllerLevel();
mousex = mousey = 0;
memset(&localview, 0, sizeof(localview));
memset(&carry, 0, sizeof(carry));
memset(&prevcarry, 0, sizeof(prevcarry));
memset(&basecmd, 0, sizeof(basecmd));
}
//
// G_DoLoadLevel
//
@ -947,12 +957,7 @@ static void G_DoLoadLevel(void)
// clear cmd building stuff
memset (gamekeydown, 0, sizeof(gamekeydown));
I_ResetControllerLevel();
mousex = mousey = 0;
memset(&localview, 0, sizeof(localview));
memset(&carry, 0, sizeof(carry));
memset(&prevcarry, 0, sizeof(prevcarry));
memset(&basecmd, 0, sizeof(basecmd));
G_ClearInput();
sendpause = sendsave = paused = false;
// [FG] array size!
memset (mousearray, 0, sizeof(mousearray));

View File

@ -32,6 +32,7 @@
#define MBF21_GAME_OPTION_SIZE (21 + MBF21_COMP_TOTAL)
void G_PrepTiccmd(void);
void G_ClearInput(void);
boolean G_MovementResponder(event_t *ev);
boolean G_Responder(event_t *ev);
boolean G_CheckDemoStatus(void);

View File

@ -6602,6 +6602,8 @@ void M_StartControlPanel (void)
currentMenu = &MainDef; // JDC
itemOn = currentMenu->lastOn; // JDC
print_warning_about_changes = false; // killough 11/98
G_ClearInput();
}
//
@ -6765,6 +6767,8 @@ static void M_ClearMenus(void)
// if (!netgame && usergame && paused)
// sendpause = true;
G_ClearInput();
}
//