From 2feda0b560afbd63f25143734d38e66a5f76401e Mon Sep 17 00:00:00 2001
From: Ronald Kinard <ronkinard93@gmail.com>
Date: Thu, 13 Nov 2014 22:34:47 -0600
Subject: [PATCH] Fix second joystick in sdl

---
 src/sdl/i_video.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c
index 322b957325..64675b533d 100644
--- a/src/sdl/i_video.c
+++ b/src/sdl/i_video.c
@@ -827,7 +827,7 @@ static void Impl_HandleJoystickAxisEvent(SDL_JoyAxisEvent evt)
 
 	// Determine the Joystick IDs for each current open joystick
 	joyid[0] = SDL_JoystickInstanceID(JoyInfo.dev);
-	joyid[1] = SDL_JoystickInstanceID(JoyInfo.dev);
+	joyid[1] = SDL_JoystickInstanceID(JoyInfo2.dev);
 
 	evt.axis++;
 	event.data1 = event.data2 = event.data3 = INT32_MAX;
@@ -866,7 +866,7 @@ static void Impl_HandleJoystickButtonEvent(SDL_JoyButtonEvent evt, Uint32 type)
 
 	// Determine the Joystick IDs for each current open joystick
 	joyid[0] = SDL_JoystickInstanceID(JoyInfo.dev);
-	joyid[1] = SDL_JoystickInstanceID(JoyInfo.dev);
+	joyid[1] = SDL_JoystickInstanceID(JoyInfo2.dev);
 
 	if (evt.which == joyid[0])
 	{
-- 
GitLab