Fixed initializing XInput user index

Sam Lantinga 2018-10-25 13:22:34 -07:00
parent 9987ca69f3
commit 545febcf21
1 changed files with 1 additions and 1 deletions

View File

@ -307,6 +307,7 @@ SDL_JoystickOpen(int device_index)
joystick->driver = driver;
joystick->instance_id = instance_id;
joystick->attached = SDL_TRUE;
joystick->userid = -1;
if (driver->Open(joystick, device_index) < 0) {
SDL_free(joystick);
@ -322,7 +323,6 @@ SDL_JoystickOpen(int device_index)
}
joystick->guid = driver->GetDeviceGUID(device_index);
joystick->userid = -1;
if (joystick->naxes > 0) {
joystick->axes = (SDL_JoystickAxisInfo *) SDL_calloc(joystick->naxes, sizeof(SDL_JoystickAxisInfo));