Skip to content

Commit

Permalink
limit Dinput devices to the max supported in input_state and update t…
Browse files Browse the repository at this point in the history
…he native submodule to get the MAX_NUM_PADS constant
  • Loading branch information
Bigpet committed Jun 1, 2014
1 parent 46eb74e commit 5e34dbf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion Windows/DinputDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion native

0 comments on commit 5e34dbf

Please sign in to comment.