浏览代码

SDL_GetJoystickIDForPlayerIndex() should return 0 for invalid ID (thanks @AntTheAlchemist!)

Sam Lantinga 2 年之前
父节点
当前提交
c9aec268fa
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/joystick/SDL_joystick.c

+ 1 - 1
src/joystick/SDL_joystick.c

@@ -232,7 +232,7 @@ static SDL_JoystickID SDL_GetJoystickIDForPlayerIndex(int player_index)
     SDL_AssertJoysticksLocked();
 
     if (player_index < 0 || player_index >= SDL_joystick_player_count) {
-        return -1;
+        return 0;
     }
     return SDL_joystick_players[player_index];
 }