mirror of
https://github.com/Maschell/controller_patcher.git
synced 2024-11-21 19:49:16 +01:00
Fixed using mutliple controller with the same vid/pid
This commit is contained in:
parent
f98014f354
commit
215f6952a6
@ -691,7 +691,7 @@ CONTROLLER_PATCHER_RESULT_OR_ERROR ControllerPatcher::gettingInputAllDevices(Inp
|
||||
|
||||
int buttons_hold = 0;
|
||||
|
||||
for(int pad = 0;pad<deviceinfo->pad_count;pad++){
|
||||
for(int pad = 0;pad<HID_MAX_PADS_COUNT;pad++){
|
||||
buttons_hold = 0;
|
||||
buttondata[pad].btn_h = 0;
|
||||
buttondata[pad].btn_d = 0;
|
||||
|
@ -471,8 +471,9 @@ CONTROLLER_PATCHER_RESULT_OR_ERROR ControllerPatcherHID::getHIDData(int hidmask,
|
||||
if(device_slot < 0){
|
||||
return CONTROLLER_PATCHER_ERROR_DEVICE_SLOT_NOT_FOUND;
|
||||
}
|
||||
|
||||
int real_pad = pad;
|
||||
if(device_slot != gHID_SLOT_GC && config_controller[device_slot][CONTRPS_PAD_COUNT][0] != CONTROLLER_PATCHER_INVALIDVALUE){
|
||||
if((device_slot != gHID_SLOT_GC) && config_controller[device_slot][CONTRPS_PAD_COUNT][0] != CONTROLLER_PATCHER_INVALIDVALUE){
|
||||
int pad_count = config_controller[device_slot][CONTRPS_PAD_COUNT][1];
|
||||
if(pad_count > HID_MAX_PADS_COUNT) pad_count = HID_MAX_PADS_COUNT;
|
||||
pad = (pad/(pad_count))*pad_count;
|
||||
|
@ -301,7 +301,7 @@ CONTROLLER_PATCHER_RESULT_OR_ERROR ControllerPatcherUtils::checkActivePad(int hi
|
||||
if(deviceslot < 0 ) return CONTROLLER_PATCHER_ERROR_DEVICE_SLOT_NOT_FOUND;
|
||||
int connected_pads = config_controller[deviceslot][CONTRPS_CONNECTED_PADS][1];
|
||||
|
||||
if(connected_pads & (1 << pad)){
|
||||
if((connected_pads & (1 << pad)) > 0){
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user