From 4a88d5ae9318decd4bf76152200fbf92b3bdb035 Mon Sep 17 00:00:00 2001 From: nitsuja Date: Sun, 18 Dec 2011 19:30:04 -0800 Subject: [PATCH] fix for wiimote dying if you use savesetates too fast (by dying I mean all wiimote slots permanently disconnecting until emulation reset) --- Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp | 2 +- Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp index 24da87c257..dbd450785d 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp @@ -129,7 +129,7 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::DoState(PointerWrap &p) // Reset the connection of all connected wiimotes for (unsigned int i = 0; i < 4; i++) { - if (m_WiiMotes[i].IsConnected()) + if (!m_WiiMotes[i].IsInactive()) { m_WiiMotes[i].Activate(false); m_WiiMotes[i].Activate(true); diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.h b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.h index 21a7d7e1bd..f3180c7dc9 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.h +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_WiiMote.h @@ -59,6 +59,7 @@ public: // we really have to clean all this code bool IsConnected() const { return m_ConnectionState == CONN_COMPLETE; } + bool IsInactive() const { return m_ConnectionState == CONN_INACTIVE; } bool LinkChannel(); void ResetChannels(); void Activate(bool ready);