Merge branch 'fix-postrace-rumble' into 'master'

Fix gamepad rumble freezing when it should stop (resolves #955)

Closes #955

See merge request KartKrew/Kart!1857
This commit is contained in:
Oni 2024-01-25 14:48:25 +00:00
commit 1d8999923c

View file

@ -733,24 +733,21 @@ static inline void P_DeviceRumbleTick(void)
UINT16 low = 0;
UINT16 high = 0;
if (player->mo == NULL)
continue;
if (player->exiting)
continue;
if ((player->mo->eflags & MFE_DAMAGEHITLAG) && player->mo->hitlag)
if (player->mo != NULL && !player->exiting)
{
low = high = 65536 / 2;
}
else if (player->sneakertimer > (sneakertime-(TICRATE/2)))
{
low = high = 65536 / (3+player->numsneakers);
}
else if (((player->boostpower < FRACUNIT) || (player->stairjank > 8))
&& P_IsObjectOnGround(player->mo) && player->speed != 0)
{
low = high = 65536 / 32;
if ((player->mo->eflags & MFE_DAMAGEHITLAG) && player->mo->hitlag)
{
low = high = 65536 / 2;
}
else if (player->sneakertimer > (sneakertime-(TICRATE/2)))
{
low = high = 65536 / (3+player->numsneakers);
}
else if (((player->boostpower < FRACUNIT) || (player->stairjank > 8))
&& P_IsObjectOnGround(player->mo) && player->speed != 0)
{
low = high = 65536 / 32;
}
}
G_PlayerDeviceRumble(i, low, high);