summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar David Marcec2019-07-08 14:51:40 +1000
committerGravatar David Marcec2019-07-08 14:51:40 +1000
commit5234e08a0d3d4630ee02acae3b85d2e2e65761b5 (patch)
tree2ddaf5770736f186acd3aa6aa05823de4bd95490 /src
parenthid:StartLrAssignmentMode, hid:StopLrAssignmentMode, hid:SwapNpadAssignment (diff)
downloadyuzu-5234e08a0d3d4630ee02acae3b85d2e2e65761b5.tar.gz
yuzu-5234e08a0d3d4630ee02acae3b85d2e2e65761b5.tar.xz
yuzu-5234e08a0d3d4630ee02acae3b85d2e2e65761b5.zip
addressed issues
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/hid/controllers/npad.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp
index 99af0469d..1e81f776f 100644
--- a/src/core/hle/service/hid/controllers/npad.cpp
+++ b/src/core/hle/service/hid/controllers/npad.cpp
@@ -563,17 +563,18 @@ bool Controller_NPad::SwapNpadAssignment(u32 npad_id_1, u32 npad_id_2) {
563 npad_id_2 == NPAD_UNKNOWN) { 563 npad_id_2 == NPAD_UNKNOWN) {
564 return true; 564 return true;
565 } 565 }
566 const auto npad_index_1 = NPadIdToIndex(npad_id_1);
567 const auto npad_index_2 = NPadIdToIndex(npad_id_2);
566 568
567 if (!IsControllerSupported(connected_controllers[NPadIdToIndex(npad_id_1)].type) || 569 if (!IsControllerSupported(connected_controllers[npad_index_1].type) ||
568 !IsControllerSupported(connected_controllers[NPadIdToIndex(npad_id_2)].type)) { 570 !IsControllerSupported(connected_controllers[npad_index_2].type)) {
569 return false; 571 return false;
570 } 572 }
571 573
572 std::swap(connected_controllers[NPadIdToIndex(npad_id_1)].type, 574 std::swap(connected_controllers[npad_index_1].type, connected_controllers[npad_index_2].type);
573 connected_controllers[NPadIdToIndex(npad_id_2)].type);
574 575
575 InitNewlyAddedControler(NPadIdToIndex(npad_id_1)); 576 InitNewlyAddedControler(npad_index_1);
576 InitNewlyAddedControler(NPadIdToIndex(npad_id_2)); 577 InitNewlyAddedControler(npad_index_2);
577 578
578 return true; 579 return true;
579} 580}