- [FIX] Removed unused variable, minor readjustment of code to avoid errors.

This commit is contained in:
2023-01-19 18:24:01 +01:00
parent 618cc83c8e
commit 3ac16958b9

View File

@@ -211,16 +211,16 @@ void destroyDisplay() {
void initGamePad() {
const int num_joysticks = SDL_NumJoysticks();
if (num_joysticks==0) return;
int gamepad_num=-1;
for (int i=0; i<num_joysticks; ++i) {
if (SDL_IsGameController(i)) {
gamepad = SDL_GameControllerOpen(i);
if (SDL_GameControllerGetAttached(gamepad) == SDL_TRUE) {
SDL_GameControllerEventState(SDL_ENABLE);
return;
if (num_joysticks>=1) {
for (int i=0; i<num_joysticks; ++i) {
if (SDL_IsGameController(i)) {
gamepad = SDL_GameControllerOpen(i);
if (SDL_GameControllerGetAttached(gamepad) == SDL_TRUE) {
SDL_GameControllerEventState(SDL_ENABLE);
return;
}
}
}
}
}
}