浏览代码

Fix adding of XInput devices (thanks, Mitchell!)

Partially fixes Bugzilla #2126.
Ryan C. Gordon 12 年之前
父节点
当前提交
5e74299a83
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/joystick/windows/SDL_dxjoystick.c

+ 1 - 1
src/joystick/windows/SDL_dxjoystick.c

@@ -733,11 +733,11 @@ AddXInputDevice(const Uint8 userid, JoyStick_DeviceData **pContext)
 
             pNewJoystick->pNext = SYS_Joystick;
             SYS_Joystick = pNewJoystick;
+            return;   /* already in the list. */
         }
 
         pPrevJoystick = pNewJoystick;
         pNewJoystick = pNewJoystick->pNext;
-        return;   /* already in the list. */
     }
 
     pNewJoystick = (JoyStick_DeviceData *) SDL_malloc(sizeof (JoyStick_DeviceData));