Merge pull request #7248 from Techjar/netplay-fix-spectator-deadlock

NetPlay: Don't update mappings on leave if player had no mappings
This commit is contained in:
spycrab 2018-07-11 01:18:22 +02:00 committed by GitHub
commit bf4341f762
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -366,7 +366,7 @@ unsigned int NetPlayServer::OnConnect(ENetPeer* socket)
// called from ---NETPLAY--- thread
unsigned int NetPlayServer::OnDisconnect(const Client& player)
{
PlayerId pid = player.pid;
const PlayerId pid = player.pid;
if (m_is_running)
{
@ -405,18 +405,18 @@ unsigned int NetPlayServer::OnDisconnect(const Client& player)
if (mapping == pid)
{
mapping = -1;
UpdatePadMapping();
}
}
UpdatePadMapping();
for (PadMapping& mapping : m_wiimote_map)
{
if (mapping == pid)
{
mapping = -1;
UpdateWiimoteMapping();
}
}
UpdateWiimoteMapping();
return 0;
}