diff options
| author | 2018-12-03 02:45:08 +1100 | |
|---|---|---|
| committer | 2018-12-03 02:45:08 +1100 | |
| commit | a9223c81820701971017e672fbb9ca065e560f7c (patch) | |
| tree | 83a03bb48e9c6d8ab17fc9755830e57c8b159031 /src | |
| parent | Merge pull request #1827 from ReinUsesLisp/clip-and-shader (diff) | |
| download | yuzu-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.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 { | |||
| 518 | } | 518 | } |
| 519 | 519 | ||
| 520 | void Controller_NPad::SetNpadMode(u32 npad_id, NPadAssignments assignment_mode) { | 520 | void 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 | ||
| 525 | void Controller_NPad::VibrateController(const std::vector<u32>& controller_ids, | 526 | void Controller_NPad::VibrateController(const std::vector<u32>& controller_ids, |