src/joystick/SDL_joystick.c
changeset 13595 36aabb2051e9
parent 13583 88068887c25d
child 13596 501950e51321
     1.1 --- a/src/joystick/SDL_joystick.c	Sat Mar 07 13:59:42 2020 -0800
     1.2 +++ b/src/joystick/SDL_joystick.c	Sat Mar 07 17:20:04 2020 -0800
     1.3 @@ -160,6 +160,9 @@
     1.4          SDL_joystick_players = new_players;
     1.5          SDL_memset(&SDL_joystick_players[SDL_joystick_player_count], 0xFF, (player_index - SDL_joystick_player_count + 1) * sizeof(SDL_joystick_players[0]));
     1.6          SDL_joystick_player_count = player_index + 1;
     1.7 +    } else if (SDL_joystick_players[player_index] == instance_id) {
     1.8 +        /* Joystick is already assigned the requested player index */
     1.9 +        return SDL_TRUE;
    1.10      }
    1.11  
    1.12      SDL_joystick_players[player_index] = instance_id;