Fixed initializing XInput user index
authorSam Lantinga <slouken@libsdl.org>
Thu, 25 Oct 2018 13:22:34 -0700
changeset 123587a7612d67fa7
parent 12357 40f09c8c517b
child 12359 691c32a30fb9
Fixed initializing XInput user index
src/joystick/SDL_joystick.c
     1.1 --- a/src/joystick/SDL_joystick.c	Thu Oct 25 12:54:42 2018 -0700
     1.2 +++ b/src/joystick/SDL_joystick.c	Thu Oct 25 13:22:34 2018 -0700
     1.3 @@ -307,6 +307,7 @@
     1.4      joystick->driver = driver;
     1.5      joystick->instance_id = instance_id;
     1.6      joystick->attached = SDL_TRUE;
     1.7 +    joystick->userid = -1;
     1.8  
     1.9      if (driver->Open(joystick, device_index) < 0) {
    1.10          SDL_free(joystick);
    1.11 @@ -322,7 +323,6 @@
    1.12      }
    1.13  
    1.14      joystick->guid = driver->GetDeviceGUID(device_index);
    1.15 -    joystick->userid = -1;
    1.16  
    1.17      if (joystick->naxes > 0) {
    1.18          joystick->axes = (SDL_JoystickAxisInfo *) SDL_calloc(joystick->naxes, sizeof(SDL_JoystickAxisInfo));