Skip to content

Commit

Permalink
try 1: Fix IndexOutOfBounds in SDL2GamepadDriver.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
GreemDev committed Nov 17, 2024
1 parent 6de3afc commit 52f42d4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Ryujinx.Input.SDL2/SDL2GamepadDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@ private void HandleJoyStickConnected(int joystickDeviceId, int joystickInstanceI
{
lock (_lock)
{
_gamepadsIds.Insert(joystickDeviceId, id);
if (joystickDeviceId <= _gamepadsIds.FindLastIndex(_ => true))
_gamepadsIds.Insert(joystickDeviceId, id);
else
_gamepadsIds.Add(id);
}

OnGamepadConnected?.Invoke(id);
Expand Down

2 comments on commit 52f42d4

@komputersbest5

This comment was marked as spam.

@GabCoolDude
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is unrelated to this commit, FC25 has never worked on Ryujinx.

Please sign in to comment.