Skip to content

Commit

Permalink
Fix pressing use key to accelerate intermission sometimes failing
Browse files Browse the repository at this point in the history
  • Loading branch information
bradharding committed Feb 23, 2025
1 parent 854ea02 commit 4da8df3
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/wi_stuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -1292,26 +1292,24 @@ static void WI_DrawStats(void)

void WI_CheckForAccelerate(void)
{
const uint8_t *keyboardstate = SDL_GetKeyboardState(NULL);

if ((viewplayer->cmd.buttons & BT_ATTACK)
|| keyboardstate[SDL_SCANCODE_RETURN]
|| keyboardstate[SDL_SCANCODE_KP_ENTER])
if (viewplayer->cmd.buttons & BT_ATTACK)
{
if (!viewplayer->attackdown)
{
acceleratestage = true;

viewplayer->attackdown = true;
viewplayer->attackdown = true;
}
}
else
viewplayer->attackdown = false;

if ((viewplayer->cmd.buttons & BT_USE) || keyboardstate[SDL_SCANCODE_SPACE])
if (viewplayer->cmd.buttons & BT_USE)
{
if (!viewplayer->usedown)
{
acceleratestage = true;

viewplayer->usedown = true;
viewplayer->usedown = true;
}
}
else
viewplayer->usedown = false;
Expand Down

0 comments on commit 4da8df3

Please sign in to comment.