Merge ca700443dbbcce10a907ecd3b945660dda496628 into ddc00cf2d8774a676c96d87c11ad2bf738c45ee2

This commit is contained in:
Ben. S. 2025-03-13 19:05:30 +00:00 committed by GitHub
commit a3221fda2e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -57,16 +57,19 @@ namespace Ryujinx.Input.SDL2
return null;
}
// Remove the first 4 char of the guid (CRC part) to make it stable
string guidString = "0000" + guid.ToString().Substring(4);
string id;
lock (_lock)
{
int guidIndex = 0;
id = guidIndex + "-" + guid;
id = guidIndex + "-" + guidString;
while (_gamepadsIds.Contains(id))
{
id = (++guidIndex) + "-" + guid;
id = (++guidIndex) + "-" + guidString;
}
}