diff --git a/libs/sdl/sdl.c b/libs/sdl/sdl.c index f5165a231..30b3a027e 100644 --- a/libs/sdl/sdl.c +++ b/libs/sdl/sdl.c @@ -271,13 +271,11 @@ HL_PRIM bool HL_NAME(event_loop)( event_data *event ) { break; case SDL_CONTROLLERDEVICEADDED: event->type = GControllerAdded; - SDL_GameController * controller = SDL_GameControllerOpen(e.cdevice.which); - SDL_Joystick* j = SDL_GameControllerGetJoystick(controller); - event->controller = SDL_JoystickInstanceID(j); + event->controller = e.jdevice.which; break; case SDL_CONTROLLERDEVICEREMOVED: event->type = GControllerRemoved; - event->controller = e.cdevice.which; + event->controller = e.jdevice.which; break; case SDL_CONTROLLERBUTTONDOWN: event->type = GControllerDown;