Pārlūkot izejas kodu

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

Bart van Strien 14 gadi atpakaļ
vecāks
revīzija
bf9ad64559
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  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;
 		}