From 1829692753cc60d9bc31c9ae5a6caebc74ee8c6a Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sat, 15 Dec 2018 09:57:05 -0500 Subject: [PATCH] emscripten: SDL_PrivateJoystickAdded() wants an instance id, not device index. --- src/joystick/emscripten/SDL_sysjoystick.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/joystick/emscripten/SDL_sysjoystick.c b/src/joystick/emscripten/SDL_sysjoystick.c index d551c8aa1..1ccfe8fa1 100644 --- a/src/joystick/emscripten/SDL_sysjoystick.c +++ b/src/joystick/emscripten/SDL_sysjoystick.c @@ -97,7 +97,7 @@ Emscripten_JoyStickConnected(int eventType, const EmscriptenGamepadEvent *gamepa ++numjoysticks; - SDL_PrivateJoystickAdded(numjoysticks - 1); + SDL_PrivateJoystickAdded(item->device_instance); #ifdef DEBUG_JOYSTICK SDL_Log("Number of joysticks is %d", numjoysticks);