Fixed the crash which occurred when opening Wiimote configuration before a game was started.

This commit is contained in:
skidau
2015-02-04 18:48:19 +11:00
parent fc8ea9c3b3
commit 3709a1ce3a
3 changed files with 9 additions and 5 deletions

View File

@ -40,8 +40,9 @@ void Shutdown()
void Initialize(void* const hwnd, bool wait)
{
// add 4 Wiimotes
for (unsigned int i = WIIMOTE_CHAN_0; i<MAX_BBMOTES; ++i)
s_config.controllers.push_back(new WiimoteEmu::Wiimote(i));
if (s_config.controllers.empty())
for (unsigned int i = WIIMOTE_CHAN_0; i < MAX_BBMOTES; ++i)
s_config.controllers.push_back(new WiimoteEmu::Wiimote(i));
g_controller_interface.Initialize(hwnd);