SDL_GetJoystickIDForPlayerIndex() should return 0 for invalid ID (thanks @AntTheAlchemist!)

This commit is contained in:
Sam Lantinga
2023-03-03 16:15:28 -08:00
parent 103fbcfc05
commit c9aec268fa

View File

@@ -232,7 +232,7 @@ static SDL_JoystickID SDL_GetJoystickIDForPlayerIndex(int player_index)
SDL_AssertJoysticksLocked(); SDL_AssertJoysticksLocked();
if (player_index < 0 || player_index >= SDL_joystick_player_count) { if (player_index < 0 || player_index >= SDL_joystick_player_count) {
return -1; return 0;
} }
return SDL_joystick_players[player_index]; return SDL_joystick_players[player_index];
} }