Fix changing wiimotes when starting netplay.
AccessWiiMote() crashed for some users. Not sure why...
This commit is contained in:
parent
ebe4448749
commit
93f7622e16
|
@ -19,6 +19,7 @@
|
|||
#include "ConfigManager.h"
|
||||
#include "Movie.h"
|
||||
#include "HW/WiimoteEmu/WiimoteEmu.h"
|
||||
#include "HW/WiimoteReal/WiimoteReal.h"
|
||||
|
||||
std::mutex crit_netplay_client;
|
||||
static NetPlayClient * netplay_client = NULL;
|
||||
|
@ -498,6 +499,7 @@ bool NetPlayClient::StartGame(const std::string &path)
|
|||
}
|
||||
|
||||
// boot game
|
||||
|
||||
m_dialog->BootGame(path);
|
||||
|
||||
UpdateDevices();
|
||||
|
@ -505,11 +507,7 @@ bool NetPlayClient::StartGame(const std::string &path)
|
|||
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bWii)
|
||||
{
|
||||
for (unsigned int i = 0; i < 4; ++i)
|
||||
{
|
||||
g_wiimote_sources[i] = m_wiimote_map[i] > 0 ? WIIMOTE_SRC_EMU : WIIMOTE_SRC_NONE;
|
||||
GetUsbPointer()->AccessWiiMote(i | 0x100)->Activate(m_wiimote_map[i] > 0);
|
||||
}
|
||||
}
|
||||
WiimoteReal::ChangeWiimoteSource(i, m_wiimote_map[i] > 0 ? WIIMOTE_SRC_EMU : WIIMOTE_SRC_NONE);
|
||||
|
||||
// Needed to prevent locking up at boot if (when) the wiimotes connect out of order.
|
||||
NetWiimote nw;
|
||||
|
@ -522,6 +520,7 @@ bool NetPlayClient::StartGame(const std::string &path)
|
|||
for (unsigned int i = 0; i < 7; ++i)
|
||||
m_wiimote_buffer[w].Push(nw);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue