mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-05 09:26:25 +00:00
Fixed rare infinite rumble in HIDAPI controller driver
This commit is contained in:
@@ -312,6 +312,9 @@ HIDAPI_DriverPS4_RumbleJoystick(SDL_HIDAPI_Device *device, SDL_Joystick *joystic
|
||||
|
||||
if ((low_frequency_rumble || high_frequency_rumble) && duration_ms) {
|
||||
ctx->rumble_expiration = SDL_GetTicks() + SDL_min(duration_ms, SDL_MAX_RUMBLE_DURATION_MS);
|
||||
if (!ctx->rumble_expiration) {
|
||||
ctx->rumble_expiration = 1;
|
||||
}
|
||||
} else {
|
||||
ctx->rumble_expiration = 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user