mirror of
https://github.com/love2d/love.git
synced 2026-08-17 11:00:31 +02:00
Prevent negative joystick button indices from being used by isDown. (as mentioned in issue #121)
This commit is contained in:
@@ -198,7 +198,7 @@ namespace sdl
|
|||||||
|
|
||||||
for (int button = *buttonlist; button != -1; button = *(++buttonlist))
|
for (int button = *buttonlist; button != -1; button = *(++buttonlist))
|
||||||
{
|
{
|
||||||
if (button < num && SDL_JoystickGetButton(joysticks[index], button) == 1)
|
if (button >= 0 && button < num && SDL_JoystickGetButton(joysticks[index], button) == 1)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user