mirror of https://github.com/libsdl-org/SDL.git
SDL_FindFreePlayerIndex() will always return the next available player index
Fixes https://github.com/libsdl-org/SDL/issues/7868
(cherry picked from commit 87e916dd21)
This commit is contained in:
parent
c6660afe44
commit
38619bb28d
|
|
@ -221,11 +221,11 @@ static int SDL_FindFreePlayerIndex()
|
||||||
|
|
||||||
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] == -1) {
|
if (SDL_joystick_players[player_index] == -1) {
|
||||||
|
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)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue