From 5f1b8bb3b838c3f5ba99e864df7906001ead1aee Mon Sep 17 00:00:00 2001 From: AJ Martinez Date: Fri, 19 Jan 2024 19:03:33 -0700 Subject: [PATCH] Fix gamepad rumble freezing when it should stop --- src/p_tick.c | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/src/p_tick.c b/src/p_tick.c index c8bb7c4ec..32005afd4 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -732,24 +732,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);