From 2eb6e21a610022d9847585137c55d15aded458f2 Mon Sep 17 00:00:00 2001 From: michaelszubartowicz <58782303+michaelszubartowicz@users.noreply.github.com> Date: Sun, 14 Mar 2021 01:45:20 +0100 Subject: [PATCH] Fix loading save states with bluetooth passthrough When a save state is loaded, the IOS device serving bluetooth is cast as BluetoothEmuDevice. If, however, a real Wiimote with BT passthrough is used, this caused the game to crash. Now the proper device class is used. --- Source/Core/Core/HW/Wiimote.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Source/Core/Core/HW/Wiimote.cpp b/Source/Core/Core/HW/Wiimote.cpp index 31dd555c2b..ed4e6a7d03 100644 --- a/Source/Core/Core/HW/Wiimote.cpp +++ b/Source/Core/Core/HW/Wiimote.cpp @@ -53,6 +53,9 @@ void UpdateSource(unsigned int index) if (!ios) return; + if (s_wiimote_sources[index] != WiimoteSource::Emulated) + return; + const auto bluetooth = std::static_pointer_cast( ios->GetDeviceByName("/dev/usb/oh1/57e/305")); if (!bluetooth)