diff --git a/Source/Core/Core/HW/Wiimote.cpp b/Source/Core/Core/HW/Wiimote.cpp index 6ca0118928..cf1d38db38 100644 --- a/Source/Core/Core/HW/Wiimote.cpp +++ b/Source/Core/Core/HW/Wiimote.cpp @@ -17,6 +17,8 @@ namespace Wiimote { static InputPlugin g_plugin(WIIMOTE_INI_NAME, _trans("Wiimote"), "Wiimote"); +static int s_last_number = 4; + InputPlugin *GetPlugin() { return &g_plugin; @@ -115,13 +117,12 @@ void Update(int _number) // TODO: change this to a try_to_lock, and make it give empty input on failure std::lock_guard lk(g_plugin.controls_lock); - static int _last_number = 4; - if (_number <= _last_number) + if (_number <= s_last_number) { g_controller_interface.UpdateOutput(); g_controller_interface.UpdateInput(); } - _last_number = _number; + s_last_number = _number; if (WIIMOTE_SRC_EMU & g_wiimote_sources[_number]) ((WiimoteEmu::Wiimote*)g_plugin.controllers[_number])->Update(); @@ -155,6 +156,7 @@ void DoState(u8 **ptr, PointerWrap::Mode mode) // TODO: PointerWrap p(ptr, mode); + p.Do(s_last_number); for (unsigned int i=0; iDoState(p); } diff --git a/Source/Core/Core/State.cpp b/Source/Core/Core/State.cpp index 1398ef7bea..59e777fec6 100644 --- a/Source/Core/Core/State.cpp +++ b/Source/Core/Core/State.cpp @@ -63,7 +63,7 @@ static Common::Event g_compressAndDumpStateSyncEvent; static std::thread g_save_thread; // Don't forget to increase this after doing changes on the savestate system -static const u32 STATE_VERSION = 24; +static const u32 STATE_VERSION = 25; enum {