Bugfix: incorrect index.

This commit is contained in:
hiker 2017-08-02 08:13:04 +10:00
parent cc6a1a3909
commit 1e5d2643be

View File

@ -314,7 +314,7 @@ void pollJoysticks()
{ {
XINPUT_STATE state; XINPUT_STATE state;
memset(&state, 0, sizeof(state)); memset(&state, 0, sizeof(state));
DWORD result = XInputGetState(joystick, &state); DWORD result = XInputGetState(ActiveJoysticks[joystick].Index, &state);
event.JoystickEvent.ButtonStates = state.Gamepad.wButtons; event.JoystickEvent.ButtonStates = state.Gamepad.wButtons;
// Thumb values are in [-32768, 32767] // Thumb values are in [-32768, 32767]
event.JoystickEvent.Axis[SEvent::SJoystickEvent::AXIS_V] = state.Gamepad.sThumbRX; event.JoystickEvent.Axis[SEvent::SJoystickEvent::AXIS_V] = state.Gamepad.sThumbRX;