Explorar o código

Prevent negative joystick button indices from being used by isDown. (as mentioned in issue #121)

Bart van Strien %!s(int64=14) %!d(string=hai) anos
pai
achega
bf9ad64559
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/modules/joystick/sdl/Joystick.cpp

+ 1 - 1
src/modules/joystick/sdl/Joystick.cpp

@@ -198,7 +198,7 @@ namespace sdl
 			
 		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;
 		}