Add back joywait

For some reason I thought this didn't do anything kek
This commit is contained in:
GenericHeroGuy 2025-03-07 13:11:42 +01:00
parent 26ca5be4e0
commit 7740b0dccd

View file

@ -2475,7 +2475,7 @@ boolean M_Responder(event_t *ev)
{ {
INT32 ch = -1; INT32 ch = -1;
// INT32 i; // INT32 i;
static tic_t mousewait = 0; static tic_t joywait = 0, mousewait = 0;
static INT32 pmousex = 0, pmousey = 0; static INT32 pmousex = 0, pmousey = 0;
static INT32 lastx = 0, lasty = 0; static INT32 lastx = 0, lasty = 0;
void (*routine)(INT32 choice); // for some casting problem void (*routine)(INT32 choice); // for some casting problem
@ -2534,12 +2534,17 @@ boolean M_Responder(event_t *ev)
if (abs(ev->data2) <= jdeadzone) if (abs(ev->data2) <= jdeadzone)
{ {
lastjoy[ev->data1] = 0; lastjoy[ev->data1] = 0;
return false; return true;
} }
tic_t thistime = I_GetTime();
// no previous direction OR change direction // no previous direction OR change direction
if (lastjoy[ev->data1] == 0 || (ev->data2 < 0) != (lastjoy[ev->data1] < 0)) if (joywait < thistime && (lastjoy[ev->data1] == 0 || (ev->data2 < 0) != (lastjoy[ev->data1] < 0)))
{
ch = KEY_AXIS1 + ev->data1*2 + (ev->data2 >= 0); ch = KEY_AXIS1 + ev->data1*2 + (ev->data2 >= 0);
joywait = thistime + NEWTICRATE/7;
}
else else
ch = 0; ch = 0;