Use proper xinput index on hotplug. Fix bad copy paste job

This commit is contained in:
Travis Nickles 2017-05-18 16:33:37 -07:00
parent 1ef0b04dbc
commit b3bd007219

View File

@ -327,9 +327,9 @@ namespace DS4Windows
device.Report += this.On_Report; device.Report += this.On_Report;
if (!getDInputOnly(Index)) if (!getDInputOnly(Index))
{ {
int xinputIndex = x360Bus.FirstController + i; int xinputIndex = x360Bus.FirstController + Index;
LogDebug("Plugging in X360 Controller #" + xinputIndex); LogDebug("Plugging in X360 Controller #" + xinputIndex);
bool xinputResult = x360Bus.Plugin(i); bool xinputResult = x360Bus.Plugin(Index);
if (xinputResult) if (xinputResult)
{ {
LogDebug("X360 Controller # " + xinputIndex + " connected"); LogDebug("X360 Controller # " + xinputIndex + " connected");
@ -687,8 +687,8 @@ namespace DS4Windows
// pull back any possible rumble data coming from Xinput consumers. // pull back any possible rumble data coming from Xinput consumers.
if (x360Bus.Report(processingData[ind].Report, processingData[ind].Rumble)) if (x360Bus.Report(processingData[ind].Report, processingData[ind].Rumble))
{ {
Byte Big = (Byte)(processingData[ind].Rumble[3]); byte Big = processingData[ind].Rumble[3];
Byte Small = (Byte)(processingData[ind].Rumble[4]); byte Small = processingData[ind].Rumble[4];
if (processingData[ind].Rumble[1] == 0x08) if (processingData[ind].Rumble[1] == 0x08)
{ {