Grab mouse input only when in-game, ungrab if in menus.

This commit is contained in:
Marco Cawthorne 2022-02-14 01:02:31 -08:00
parent 8f7196e3e8
commit 95be4c9c91
Signed by: eukara
GPG Key ID: C196CD8BA993248A
1 changed files with 6 additions and 0 deletions

6
game.c
View File

@ -2440,6 +2440,9 @@ void displayrest(long smoothratio)
{
if( (ps[myconnectindex].gm&MODE_MENU) == MODE_MENU && current_menu < 51)
{
// out menu --eukara
SDL_WM_GrabInput(SDL_GRAB_ON);
KB_ClearKeyDown(sc_Escape);
ps[myconnectindex].gm &= ~MODE_MENU;
if(ud.multimode < 2 && ud.recstat != 2)
@ -2456,6 +2459,9 @@ void displayrest(long smoothratio)
ps[myconnectindex].newowner == -1 &&
(ps[myconnectindex].gm&MODE_TYPE) != MODE_TYPE)
{
// in menu --eukara
SDL_WM_GrabInput(SDL_GRAB_OFF);
KB_ClearKeyDown(sc_Escape);
FX_StopAllSounds();
clearsoundlocks();