diff options
Diffstat (limited to 'src/i_joystick.c')
-rw-r--r-- | src/i_joystick.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/i_joystick.c b/src/i_joystick.c index 3eb9069d..b6333334 100644 --- a/src/i_joystick.c +++ b/src/i_joystick.c @@ -163,13 +163,16 @@ static int GetAxisState(int axis, int invert) void I_UpdateJoystick(void) { - event_t ev; + if (joystick != NULL) + { + event_t ev; - ev.type = ev_joystick; - ev.data1 = GetButtonState(); - ev.data2 = GetAxisState(joystick_x_axis, joystick_x_invert); - ev.data3 = GetAxisState(joystick_y_axis, joystick_y_invert); + ev.type = ev_joystick; + ev.data1 = GetButtonState(); + ev.data2 = GetAxisState(joystick_x_axis, joystick_x_invert); + ev.data3 = GetAxisState(joystick_y_axis, joystick_y_invert); - D_PostEvent(&ev); + D_PostEvent(&ev); + } } |