From e26ed735337bc82b72b472f5769334a995458a8a Mon Sep 17 00:00:00 2001 From: kalaposfos13 <153381648+kalaposfos13@users.noreply.github.com> Date: Fri, 25 Apr 2025 18:38:05 +0200 Subject: [PATCH] Print error on SDL_SetGamepadPlayerIndex failure --- src/input/controller.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/input/controller.cpp b/src/input/controller.cpp index 0d9a307ba..41e35eaaf 100644 --- a/src/input/controller.cpp +++ b/src/input/controller.cpp @@ -287,7 +287,10 @@ void GameControllers::TryOpenSDLControllers(GameControllers& controllers) { controllers[i]->m_sdl_gamepad = pad; controllers[i]->user_id = i + 1; slot_taken[i] = true; - SDL_SetGamepadPlayerIndex(pad, i); + bool err = SDL_SetGamepadPlayerIndex(pad, i); + if (!err) { + LOG_ERROR(Input, "Failed to set controller index: {}", SDL_GetError()); + } AddUserServiceEvent( {OrbisUserServiceEventType::Login, SDL_GetGamepadPlayerIndex(pad) + 1});