Skip to content

Commit

Permalink
[netplay] Fix a regression
Browse files Browse the repository at this point in the history
Introduced in 6e13496, pads would get assigned to their netplay
position, which breaks assumptions. With this behavior, the SI devices
should be mapped properly.
  • Loading branch information
mathieui committed Jan 27, 2016
1 parent 9199539 commit 24cb648
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions Source/Core/Core/NetPlayClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -758,13 +758,29 @@ bool NetPlayClient::ChangeGame(const std::string&)
// called from ---NETPLAY--- thread
void NetPlayClient::UpdateDevices()
{
for (PadMapping i = 0; i < 4; i++)
u8 local_pad = 0;
// Add local pads first:
// As stated in the comment in NetPlayClient::GetNetPads, the pads pertaining
// to the local user are always locally mapped to the first gamecube ports,
// so they should be added first.
for (auto player_id : m_pad_map)
{
// Use local controller types for local controllers
if (m_pad_map[i] == m_local_player->pid)
SerialInterface::AddDevice(SConfig::GetInstance().m_SIDevice[i], i);
else
SerialInterface::AddDevice(m_pad_map[i] > 0 ? SIDEVICE_GC_CONTROLLER : SIDEVICE_NONE, i);
if (player_id == m_local_player->pid)
{
SerialInterface::AddDevice(SConfig::GetInstance().m_SIDevice[local_pad], local_pad);
local_pad++;
}
}
for (auto player_id : m_pad_map)
{
if (player_id != m_local_player->pid)
{
// Only GCController-like controllers are supported, GBA and similar
// exotic devices are not supported on netplay.
SerialInterface::AddDevice(player_id > 0 ? SIDEVICE_GC_CONTROLLER : SIDEVICE_NONE, local_pad);
local_pad++;
}
}
}

Expand Down

0 comments on commit 24cb648

Please sign in to comment.