Add new virtual joysticks to the end of the list
This guarantees that the device index that's returned is stable, as long as no joystick hotplug events occur.
This commit is contained in:
1 parent
3c3ccb1d48
commit
1f2a241688
2 files changed
+11
-3
No files matched your search
@@ -365,7 +365,7 @@ static void CloseVirtualController()
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < SDL_NumJoysticks(); ++i) {
|
||||
for (i = SDL_NumJoysticks(); i--; ) {
|
||||
if (SDL_JoystickIsVirtual(i)) {
|
||||
SDL_JoystickDetachVirtual(i);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user