src/joystick/windows/SDL_xinputjoystick.c
changeset 12359 691c32a30fb9
parent 12357 40f09c8c517b
child 12503 806492103856
     1.1 --- a/src/joystick/windows/SDL_xinputjoystick.c	Thu Oct 25 13:22:34 2018 -0700
     1.2 +++ b/src/joystick/windows/SDL_xinputjoystick.c	Thu Oct 25 16:53:14 2018 -0700
     1.3 @@ -312,6 +312,8 @@
     1.4      SDL_assert(XINPUTSETSTATE);
     1.5      SDL_assert(userId < XUSER_MAX_COUNT);
     1.6  
     1.7 +    joystick->player_index = userId;
     1.8 +
     1.9      joystick->hwdata->bXInputDevice = SDL_TRUE;
    1.10  
    1.11      if (XINPUTGETCAPABILITIES(userId, XINPUT_FLAG_GAMEPAD, &capabilities) != ERROR_SUCCESS) {
    1.12 @@ -322,7 +324,6 @@
    1.13      SDL_zero(state);
    1.14      joystick->hwdata->bXInputHaptic = (XINPUTSETSTATE(userId, &state) == ERROR_SUCCESS);
    1.15      joystick->hwdata->userid = userId;
    1.16 -    joystick->userid = userId;
    1.17  
    1.18      /* The XInput API has a hard coded button/axis mapping, so we just match it */
    1.19      if (SDL_XInputUseOldJoystickMapping()) {