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 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(value) < m_attachments.size()) + return u32(value); return 0; }