mirror of
https://github.com/encounter/SDL.git
synced 2025-12-21 10:49:12 +00:00
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:
@@ -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