From fa5475ba9f02db9f58497ac03ab93b5f0a26175d Mon Sep 17 00:00:00 2001
From: Mathieu Eyraud <[EMAIL REDACTED]>
Date: Mon, 2 Jan 2023 10:18:42 +0100
Subject: [PATCH] Fix joystick instance id check
---
src/joystick/SDL_joystick.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c
index 14861824db39..cc98e7639918 100644
--- a/src/joystick/SDL_joystick.c
+++ b/src/joystick/SDL_joystick.c
@@ -277,7 +277,7 @@ static SDL_bool SDL_SetJoystickIDForPlayerIndex(int player_index, SDL_JoystickID
}
/* Move any existing joystick to another slot */
- if (existing_instance >= 0) {
+ if (existing_instance > 0) {
SDL_SetJoystickIDForPlayerIndex(SDL_FindFreePlayerIndex(), existing_instance);
}
return SDL_TRUE;