diff options
author | bunnei <bunneidev@gmail.com> | 2018-12-03 23:02:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-03 23:02:40 +0100 |
commit | a238cdb5ca0805c8b89d952ca05e9b896571e845 (patch) | |
tree | 761b39d410f02ae5185da2f89e375e52d2854178 | |
parent | Merge pull request #1843 from lioncash/table (diff) | |
parent | Fixed crash with SetNpadMode (diff) | |
download | yuzu-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.cpp | 5 |
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, |