Fixed infinite recursion in SDL_IsGamepad()

SDL_IsGamepad() calls SDL_GetJoystickTypeForID(), which will call SDL_IsGamepad() if it's not a known controller type. The new code which is breaking was added to prevent Logitech FFB wheels from showing up as gamepads, which we check for separately.
This commit is contained in:
Sam Lantinga 2025-03-17 19:10:26 -07:00
parent 6d0fb0a2e6
commit 5985f0a327
3 changed files with 11 additions and 6 deletions

View file

@ -3049,7 +3049,7 @@ bool SDL_IsJoystickVIRTUAL(SDL_GUID guid)
return (guid.data[14] == 'v') ? true : false;
}
static bool SDL_IsJoystickWheel(Uint16 vendor_id, Uint16 product_id)
bool SDL_IsJoystickWheel(Uint16 vendor_id, Uint16 product_id)
{
return SDL_VIDPIDInList(vendor_id, product_id, &wheel_devices);
}