gcadapter: fix an incorrect mapping for non-local devices

Remote devices would always enter an error path and get disconnected
from the gamecube, breaking netplay in the process.

Culprit is still InGamePadToLocalPad
This commit is contained in:
mathieui 2016-01-28 02:46:58 +01:00
parent b9b4a0c530
commit 4529930f91

View File

@ -40,12 +40,14 @@ int CSIDevice_GCAdapter::RunBuffer(u8* _pBuffer, int _iLength)
// Read the command
EBufferCommands command = static_cast<EBufferCommands>(_pBuffer[3]);
// get the correct pad number that should rumble locally when using netplay
const u8 numPAD = NetPlay_InGamePadToLocalPad(ISIDevice::m_iDeviceNumber);
if (!GCAdapter::DeviceConnected(numPAD))
if (numPAD < 4)
{
reinterpret_cast<u32*>(_pBuffer)[0] = SI_NONE;
return 4;
if (!GCAdapter::DeviceConnected(numPAD))
{
reinterpret_cast<u32*>(_pBuffer)[0] = SI_NONE;
return 4;
}
}
// Handle it