Only use the allowed joystick axis values (max is 2 - range check).
This commit is contained in:
parent
4c1bd993e4
commit
1566a9ea06
|
@ -100,7 +100,10 @@ static void doButtonUp(SDL_JoyButtonEvent *event)
|
|||
|
||||
static void doJoyAxis(SDL_JoyAxisEvent *event)
|
||||
{
|
||||
app.joypadAxis[event->axis] = event->value;
|
||||
if (event->axis < JOYPAD_AXIS_MAX)
|
||||
{
|
||||
app.joypadAxis[event->axis] = event->value;
|
||||
}
|
||||
}
|
||||
|
||||
void clearInput(void)
|
||||
|
|
Loading…
Reference in New Issue