Skip to content

Commit

Permalink
engine: client: clear mouse state along with everything else in Key_C…
Browse files Browse the repository at this point in the history
…learStates
  • Loading branch information
a1batross committed Jan 6, 2025
1 parent 93d3df8 commit 4788a4e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions engine/client/keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -856,18 +856,22 @@ void GAME_EXPORT Key_ClearStates( void )
int i;

// don't clear keys during changelevel
if( cls.changelevel ) return;
if( cls.changelevel )
return;

for( i = 0; i < 256; i++ )
{
if( keys[i].down )
if( keys[i].down && key < K_MOUSE1 && key > K_MOUSE5 )
Key_Event( i, false );

keys[i].down = 0;
keys[i].repeats = 0;
keys[i].gamedown = 0;
}

for( i = K_MOUSE1; i < K_MOUSE5; i++ ) // from K_MOUSE1 to K_MOUSE5
IN_MouseEvent( i - K_MOUSE1, false );

if( clgame.hInstance )
clgame.dllFuncs.IN_ClearStates();
}
Expand Down

0 comments on commit 4788a4e

Please sign in to comment.