Merge branch 'stupid-input-events' into 'master'

Fix the last 128 input events repeating when restarting Time Attack with the Y button

See merge request KartKrew/Kart!2044
This commit is contained in:
Oni 2024-03-09 03:12:35 +00:00
commit 6800ba3cf4

View file

@ -272,9 +272,19 @@ void D_ProcessEvents(boolean callresponders)
boolean eaten;
G_ResetAllDeviceResponding();
for (; eventtail != eventhead; eventtail = (eventtail+1) & (MAXEVENTS-1))
// Save these in local variables because eventtail !=
// eventhead was evaluating true when they were equal,
// but only when using the Y button to restart a Time
// Attack??
INT32 tail = eventtail;
INT32 head = eventhead;
eventtail = eventhead;
for (; tail != head; tail = (tail+1) & (MAXEVENTS-1))
{
ev = &events[eventtail];
ev = &events[tail];
HandleGamepadDeviceEvents(ev);