limit Dinput devices to the max supported in input_state and update the native submodule to get the MAX_NUM_PADS constant

This commit is contained in:
Peter Tissen committed 2014-06-01 12:37:32 +02:00
1 parent 46eb74e98a
commit 5e34dbf3fc
2 files changed
+7 -2

No files matched your search

+6 -1
View File
@@ -143,8 +143,13 @@ DinputDevice::DinputDevice(int devnum) {
return;
}
if (devnum >= MAX_NUM_PADS)
{
return;
}
getDevices();
if ( (devnum > devices.size()) || FAILED(getPDI()->CreateDevice(devices.at(devnum).guidInstance, &pJoystick, NULL)))
if ( (devnum >= devices.size()) || FAILED(getPDI()->CreateDevice(devices.at(devnum).guidInstance, &pJoystick, NULL)))
{
return;
}