From: Ivo Ivanov <logos128(a)gmail.com> Signed-off-by: Ivo Ivanov <logos128(a)gmail.com> --- dlls/dinput/joystick_hid.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/dinput/joystick_hid.c b/dlls/dinput/joystick_hid.c index ebebbee6eb2..3ea15009d8f 100644 --- a/dlls/dinput/joystick_hid.c +++ b/dlls/dinput/joystick_hid.c @@ -2350,7 +2350,8 @@ static void convert_directions_from_spherical( const DIEFFECT *in, DIEFFECT *out tmp = cos( in->rglDirection[i - 1] * M_PI / 18000 ) * 10000; for (j = 0; j < i; ++j) out->rglDirection[j] = round( out->rglDirection[j] * tmp / 10000.0 ); - out->rglDirection[i] = sin( in->rglDirection[i - 1] * M_PI / 18000 ) * 10000; + if (i < in->cAxes) + out->rglDirection[i] = sin( in->rglDirection[i - 1] * M_PI / 18000 ) * 10000; } out->cAxes = in->cAxes; break; -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/1493