From 215f6952a6c60f44bbf695c3817f476178d1e011 Mon Sep 17 00:00:00 2001 From: Maschell Date: Sun, 2 Apr 2017 19:05:31 +0200 Subject: [PATCH] Fixed using mutliple controller with the same vid/pid --- ControllerPatcher.cpp | 2 +- patcher/ControllerPatcherHID.cpp | 3 ++- patcher/ControllerPatcherUtils.cpp | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ControllerPatcher.cpp b/ControllerPatcher.cpp index 7baf03e..f22b114 100644 --- a/ControllerPatcher.cpp +++ b/ControllerPatcher.cpp @@ -691,7 +691,7 @@ CONTROLLER_PATCHER_RESULT_OR_ERROR ControllerPatcher::gettingInputAllDevices(Inp int buttons_hold = 0; - for(int pad = 0;padpad_count;pad++){ + for(int pad = 0;pad HID_MAX_PADS_COUNT) pad_count = HID_MAX_PADS_COUNT; pad = (pad/(pad_count))*pad_count; diff --git a/patcher/ControllerPatcherUtils.cpp b/patcher/ControllerPatcherUtils.cpp index 5194e8e..95016b2 100644 --- a/patcher/ControllerPatcherUtils.cpp +++ b/patcher/ControllerPatcherUtils.cpp @@ -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; } }