From 111b159373250e60cd4f1f6e2797325e6278f908 Mon Sep 17 00:00:00 2001 From: Themaister Date: Sun, 12 Jun 2011 10:37:04 +0200 Subject: [PATCH] Should fix dinput. --- input/dinput.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/input/dinput.c b/input/dinput.c index 92b25df7f5..4ac5b3fa9c 100644 --- a/input/dinput.c +++ b/input/dinput.c @@ -77,10 +77,12 @@ static BOOL CALLBACK enum_joypad_cb(const DIDEVICEINSTANCE *inst, void *p) if (active == MAX_PLAYERS) return DIENUM_STOP; - if (FAILED(IDirectInput8_CreateDevice(di->ctx, &inst->guidInstance, &di->joypad[n], NULL))) + di->joypad_cnt++; + if (n == MAX_PLAYERS) return DIENUM_CONTINUE; - di->joypad_cnt++; + if (FAILED(IDirectInput8_CreateDevice(di->ctx, &inst->guidInstance, &di->joypad[n], NULL))) + return DIENUM_STOP; IDirectInputDevice8_SetDataFormat(di->joypad[n], &c_dfDIJoystick2); IDirectInputDevice8_SetCooperativeLevel(di->joypad[n], di->hWnd,