summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar David Marcec2018-12-03 02:45:08 +1100
committerGravatar David Marcec2018-12-03 02:45:08 +1100
commita9223c81820701971017e672fbb9ca065e560f7c (patch)
tree83a03bb48e9c6d8ab17fc9755830e57c8b159031 /src
parentMerge pull request #1827 from ReinUsesLisp/clip-and-shader (diff)
downloadyuzu-a9223c81820701971017e672fbb9ca065e560f7c.tar.gz
yuzu-a9223c81820701971017e672fbb9ca065e560f7c.tar.xz
yuzu-a9223c81820701971017e672fbb9ca065e560f7c.zip
Fixed crash with SetNpadMode
fixed crash due to handheld
Diffstat (limited to 'src')
-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 {
518} 518}
519 519
520void Controller_NPad::SetNpadMode(u32 npad_id, NPadAssignments assignment_mode) { 520void Controller_NPad::SetNpadMode(u32 npad_id, NPadAssignments assignment_mode) {
521 ASSERT(npad_id < shared_memory_entries.size()); 521 const std::size_t npad_index = NPadIdToIndex(npad_id);
522 shared_memory_entries[npad_id].pad_assignment = assignment_mode; 522 ASSERT(npad_index < shared_memory_entries.size());
523 shared_memory_entries[npad_index].pad_assignment = assignment_mode;
523} 524}
524 525
525void Controller_NPad::VibrateController(const std::vector<u32>& controller_ids, 526void Controller_NPad::VibrateController(const std::vector<u32>& controller_ids,