Commit 1829692753cc60d9bc31c9ae5a6caebc74ee8c6a

Ryan C. Gordon 2018-12-15T09:57:05

emscripten: SDL_PrivateJoystickAdded() wants an instance id, not device index.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/joystick/emscripten/SDL_sysjoystick.c b/src/joystick/emscripten/SDL_sysjoystick.c
index d551c8a..1ccfe8f 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);