diff options
| author | Admiral H. Curtiss <pikachu025@gmail.com> | 2022-09-07 21:06:26 +0200 |
|---|---|---|
| committer | Admiral H. Curtiss <pikachu025@gmail.com> | 2022-09-07 21:06:26 +0200 |
| commit | 67c97a0bf26b4272632e3aaaab43fd571f0cfe70 (patch) | |
| tree | 940d9b6af7f326ce97c878afbd9dc860dad26e70 /Source/Core/InputCommon/ControllerInterface/WGInput/WGInput.cpp | |
| parent | 48c9c224cf9f82f0f9f2690b7cc6283d7448480c (diff) | |
WGInput: Work around crash with Steam overlay.
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface/WGInput/WGInput.cpp')
| -rw-r--r-- | Source/Core/InputCommon/ControllerInterface/WGInput/WGInput.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/WGInput/WGInput.cpp b/Source/Core/InputCommon/ControllerInterface/WGInput/WGInput.cpp index 414d246069..fc6441bb8d 100644 --- a/Source/Core/InputCommon/ControllerInterface/WGInput/WGInput.cpp +++ b/Source/Core/InputCommon/ControllerInterface/WGInput/WGInput.cpp @@ -544,8 +544,12 @@ private: { try { + // Workaround for Steam. If Steam's GameOverlayRenderer64.dll is loaded, battery_info is null. + auto battery_info = m_raw_controller.try_as<WGI::IGameControllerBatteryInfo>(); + if (!battery_info) + return false; const winrt::Windows::Devices::Power::BatteryReport report = - m_raw_controller.TryGetBatteryReport(); + battery_info.TryGetBatteryReport(); if (!report) return false; |
