Merge pull request #7758 from jordan-woyak/wiimote-source-change-fix

HW/Wiimote: Wiimote source change reconnection fix
This commit is contained in:
JosJuice 2019-01-30 19:01:31 +01:00 committed by GitHub
commit 4166c55c2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -768,6 +768,13 @@ void Pause()
void ChangeWiimoteSource(unsigned int index, int source)
{
const int previous_source = g_wiimote_sources[index];
if (previous_source == source)
{
// No change. Do nothing.
return;
}
g_wiimote_sources[index] = source;
{
// kill real connection (or swap to different slot)
@ -919,4 +926,4 @@ bool IsNewWiimote(const std::string& identifier)
return s_known_ids.count(identifier) == 0;
}
}; // end of namespace
}; // namespace WiimoteReal