Only use the allowed joystick axis values (max is 2 - range check).

This commit is contained in:
Steve 2018-04-21 09:41:46 +01:00
parent 4c1bd993e4
commit 1566a9ea06
1 changed files with 4 additions and 1 deletions

View File

@ -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)