diff options
| author | Lioncash <mathew1800@gmail.com> | 2019-08-02 10:16:26 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2019-08-02 10:26:44 -0400 |
| commit | 37d643c7d3055c40ebaca920f7efa34a6337379b (patch) | |
| tree | 6c95768c65c87a38786a1ba5920481cdf1b090ee /Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp | |
| parent | c70da390a76af650a44bdddd8f75083c54cebed6 (diff) | |
InputCommon/DInputJoystick: Correct force-feedback flag testing
Introduced in a995e2f5ba3bb55b4245675428bbdc3d34cb7355
We need to be performing a bitwise AND on the flags and not a logical
AND, otherwise we could end up counting device objects that don't
support forced feedback.
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp')
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp b/Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp index bba6b87ae6..ff27eedf44 100644 --- a/Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp +++ b/Source/Core/InputCommon/ControllerInterface/DInput/DInputJoystick.cpp @@ -164,9 +164,8 @@ Joystick::Joystick(/*const LPCDIDEVICEINSTANCE lpddi, */ const LPDIRECTINPUTDEVI if (SUCCEEDED(m_device->EnumObjects(DIEnumDeviceObjectsCallback, (LPVOID)&objects, DIDFT_AXIS))) { const int num_ff_axes = - std::count_if(std::begin(objects), std::end(objects), [](DIDEVICEOBJECTINSTANCE& pdidoi) { - return pdidoi.dwFlags && DIDOI_FFACTUATOR; - }); + std::count_if(std::begin(objects), std::end(objects), + [](const auto& pdidoi) { return (pdidoi.dwFlags & DIDOI_FFACTUATOR) != 0; }); InitForceFeedback(m_device, num_ff_axes); } |
