src/joystick/SDL_joystick.c
changeset 13595 36aabb2051e9
parent 13583 88068887c25d
child 13596 501950e51321
equal deleted inserted replaced
13594:9b5e16574ea9 13595:36aabb2051e9
   158         }
   158         }
   159 
   159 
   160         SDL_joystick_players = new_players;
   160         SDL_joystick_players = new_players;
   161         SDL_memset(&SDL_joystick_players[SDL_joystick_player_count], 0xFF, (player_index - SDL_joystick_player_count + 1) * sizeof(SDL_joystick_players[0]));
   161         SDL_memset(&SDL_joystick_players[SDL_joystick_player_count], 0xFF, (player_index - SDL_joystick_player_count + 1) * sizeof(SDL_joystick_players[0]));
   162         SDL_joystick_player_count = player_index + 1;
   162         SDL_joystick_player_count = player_index + 1;
       
   163     } else if (SDL_joystick_players[player_index] == instance_id) {
       
   164         /* Joystick is already assigned the requested player index */
       
   165         return SDL_TRUE;
   163     }
   166     }
   164 
   167 
   165     SDL_joystick_players[player_index] = instance_id;
   168     SDL_joystick_players[player_index] = instance_id;
   166 
   169 
   167     /* Update the driver with the new index */
   170     /* Update the driver with the new index */