SDL_FindFreePlayerIndex() will always return the next available player index

Fixes https://github.com/libsdl-org/SDL/issues/7868
main
Sam Lantinga 2023-06-24 15:38:38 -07:00
parent 267fdd7daa
commit 87e916dd21
1 changed files with 2 additions and 2 deletions

View File

@ -218,11 +218,11 @@ static int SDL_FindFreePlayerIndex(void)
for (player_index = 0; player_index < SDL_joystick_player_count; ++player_index) { for (player_index = 0; player_index < SDL_joystick_player_count; ++player_index) {
if (SDL_joystick_players[player_index] == 0) { if (SDL_joystick_players[player_index] == 0) {
break;
}
}
return player_index; return player_index;
} }
}
return -1;
}
static int SDL_GetPlayerIndexForJoystickID(SDL_JoystickID instance_id) static int SDL_GetPlayerIndexForJoystickID(SDL_JoystickID instance_id)
{ {