diff options
| author | JMC47 <JMC4789@gmail.com> | 2021-05-19 14:18:46 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-19 14:18:46 -0400 |
| commit | fbf7e93f9bc6df2581b37d51ee47d8457149159c (patch) | |
| tree | 0cfd71788bd0c8fdfa4d009050b4f0ef2890e6fa /Source/Core/InputCommon/ControllerEmu/ControlGroup/Attachments.cpp | |
| parent | 736de8abf618fdd3846ec90fa3d51a71ed3d0a68 (diff) | |
| parent | 379ffc268d30c66c9cc43a15998369de769efaf0 (diff) | |
Merge pull request #9689 from Filoppi/input_cleanup_2
Input cleanup 2
Diffstat (limited to 'Source/Core/InputCommon/ControllerEmu/ControlGroup/Attachments.cpp')
| -rw-r--r-- | Source/Core/InputCommon/ControllerEmu/ControlGroup/Attachments.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Source/Core/InputCommon/ControllerEmu/ControlGroup/Attachments.cpp b/Source/Core/InputCommon/ControllerEmu/ControlGroup/Attachments.cpp index 6f980d8c60..18ccbc1966 100644 --- a/Source/Core/InputCommon/ControllerEmu/ControlGroup/Attachments.cpp +++ b/Source/Core/InputCommon/ControllerEmu/ControlGroup/Attachments.cpp @@ -17,10 +17,11 @@ void Attachments::AddAttachment(std::unique_ptr<EmulatedController> att) u32 Attachments::GetSelectedAttachment() const { - const u32 value = m_selection_value.GetValue(); + // This is originally an int, treat it as such + const int value = m_selection_value.GetValue(); - if (value < m_attachments.size()) - return value; + if (value > 0 && static_cast<size_t>(value) < m_attachments.size()) + return u32(value); return 0; } |
