(Dinput joypad) Prevent input going haywire once pad is disconnected
This commit is contained in:
parent
f06607141d
commit
5d8d6e18b2
|
@ -426,7 +426,12 @@ static bool dinput_joypad_init(void *data)
|
|||
static bool dinput_joypad_button(unsigned port_num, uint16_t joykey)
|
||||
{
|
||||
const struct dinput_joypad_data *pad = &g_pads[port_num];
|
||||
unsigned hat_dir = GET_HAT_DIR(joykey);
|
||||
unsigned hat_dir = 0;
|
||||
|
||||
if (!pad || !pad->joypad)
|
||||
return false;
|
||||
|
||||
hat_dir = GET_HAT_DIR(joykey);
|
||||
|
||||
if (hat_dir)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue