Update rcore_desktop_sdl.c
raylib app crashing when started and a gamepad is already connected to the PC (even if the gamepad is not used in the app). I only tested this with a gamepad that has a layout which is not recognized. Using SDL3 as backend.
This commit is contained in:
parent
beaadc9185
commit
55c6864092
1 changed files with 1 additions and 1 deletions
|
@ -1670,7 +1670,7 @@ void PollInputEvents(void)
|
|||
{
|
||||
int jid = event.jdevice.which; // Joystick device index
|
||||
|
||||
if (!CORE.Input.Gamepad.ready[jid] && (jid < MAX_GAMEPADS))
|
||||
if (CORE.Input.Gamepad.ready[jid] && (jid < MAX_GAMEPADS))
|
||||
{
|
||||
platform.gamepad[jid] = SDL_GameControllerOpen(jid);
|
||||
platform.gamepadId[jid] = SDL_JoystickInstanceID(SDL_GameControllerGetJoystick(platform.gamepad[jid]));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue