Skip to content

Commit

Permalink
Revert "180° Turn only once per button press"
Browse files Browse the repository at this point in the history
This reverts commit ba920ff.
  • Loading branch information
Noseey committed Nov 23, 2024
1 parent ba920ff commit 40081f8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 30 deletions.
13 changes: 3 additions & 10 deletions src/doom/g_game.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,6 @@ void G_BuildTiccmd (ticcmd_t* cmd, int maketic)
int look;
player_t *const player = &players[consoleplayer];
static char playermessage[48];
static boolean keyrevstate = false; // [crispy]

// [crispy] For fast polling.
G_PrepTiccmd();
Expand Down Expand Up @@ -507,15 +506,9 @@ void G_BuildTiccmd (ticcmd_t* cmd, int maketic)
// [crispy] add quick 180° reverse
if (gamekeydown[key_reverse] || mousebuttons[mousebreverse])
{
if(!keyrevstate)
{
angle += ANG180 >> FRACBITS;
keyrevstate = true;
}
}
else
{
keyrevstate = false;
angle += ANG180 >> FRACBITS;
gamekeydown[key_reverse] = false;
mousebuttons[mousebreverse] = false;
}

// [crispy] toggle "always run"
Expand Down
13 changes: 3 additions & 10 deletions src/heretic/g_game.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,6 @@ void G_BuildTiccmd(ticcmd_t *cmd, int maketic)

static unsigned int mbmlookctrl = 0; // [crispy]
static unsigned int kbdlookctrl = 0; // [crispy]
static boolean keyrevstate = false; // [crispy]

// haleyjd: removed externdriver crap

Expand Down Expand Up @@ -467,15 +466,9 @@ void G_BuildTiccmd(ticcmd_t *cmd, int maketic)
// [crispy] add quick 180° reverse
if (gamekeydown[key_reverse] || mousebuttons[mousebreverse])
{
if(!keyrevstate)
{
angle += ANG180 >> FRACBITS;
keyrevstate = true;
}
}
else
{
keyrevstate = false;
angle += ANG180 >> FRACBITS;
gamekeydown[key_reverse] = false;
mousebuttons[mousebreverse] = false;
}

// [crispy] toggle "always run"
Expand Down
13 changes: 3 additions & 10 deletions src/hexen/g_game.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ void G_BuildTiccmd(ticcmd_t *cmd, int maketic)

static unsigned int mbmlookctrl = 0; // [crispy]
static unsigned int kbdlookctrl = 0; // [crispy]
static boolean keyrevstate = false; // [crispy]

// haleyjd: removed externdriver crap

Expand Down Expand Up @@ -365,15 +364,9 @@ void G_BuildTiccmd(ticcmd_t *cmd, int maketic)
// [crispy] add quick 180° reverse
if (gamekeydown[key_reverse] || mousebuttons[mousebreverse])
{
if(!keyrevstate)
{
angle += ANG180 >> FRACBITS;
keyrevstate = true;
}
}
else
{
keyrevstate = false;
angle += ANG180 >> FRACBITS;
gamekeydown[key_reverse] = false;
mousebuttons[mousebreverse] = false;
}

// [crispy] toggle "always run"
Expand Down

0 comments on commit 40081f8

Please sign in to comment.