summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-12-03 23:02:40 +0100
committerGitHub <noreply@github.com>2018-12-03 23:02:40 +0100
commita238cdb5ca0805c8b89d952ca05e9b896571e845 (patch)
tree761b39d410f02ae5185da2f89e375e52d2854178
parentMerge pull request #1843 from lioncash/table (diff)
parentFixed crash with SetNpadMode (diff)
downloadyuzu-a238cdb5ca0805c8b89d952ca05e9b896571e845.tar
yuzu-a238cdb5ca0805c8b89d952ca05e9b896571e845.tar.gz
yuzu-a238cdb5ca0805c8b89d952ca05e9b896571e845.tar.bz2
yuzu-a238cdb5ca0805c8b89d952ca05e9b896571e845.tar.lz
yuzu-a238cdb5ca0805c8b89d952ca05e9b896571e845.tar.xz
yuzu-a238cdb5ca0805c8b89d952ca05e9b896571e845.tar.zst
yuzu-a238cdb5ca0805c8b89d952ca05e9b896571e845.zip
-rw-r--r--src/core/hle/service/hid/controllers/npad.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/hle/service/hid/controllers/npad.cpp b/src/core/hle/service/hid/controllers/npad.cpp
index 22e87a50a..b49e34594 100644
--- a/src/core/hle/service/hid/controllers/npad.cpp
+++ b/src/core/hle/service/hid/controllers/npad.cpp
@@ -518,8 +518,9 @@ Controller_NPad::NpadHoldType Controller_NPad::GetHoldType() const {
}
void Controller_NPad::SetNpadMode(u32 npad_id, NPadAssignments assignment_mode) {
- ASSERT(npad_id < shared_memory_entries.size());
- shared_memory_entries[npad_id].pad_assignment = assignment_mode;
+ const std::size_t npad_index = NPadIdToIndex(npad_id);
+ ASSERT(npad_index < shared_memory_entries.size());
+ shared_memory_entries[npad_index].pad_assignment = assignment_mode;
}
void Controller_NPad::VibrateController(const std::vector<u32>& controller_ids,