Fixed index bug in hotplug routine

This commit is contained in:
Travis Nickles 2017-12-31 09:11:46 -06:00
parent 2778b01d9b
commit 1d238e8b8b

View File

@ -326,14 +326,14 @@ namespace DS4Windows
device.SerialChange += this.On_SerialChange; device.SerialChange += this.On_SerialChange;
if (device.isValidSerial() && containsLinkedProfile(device.getMacAddress())) if (device.isValidSerial() && containsLinkedProfile(device.getMacAddress()))
{ {
ProfilePath[i] = getLinkedProfile(device.getMacAddress()); ProfilePath[Index] = getLinkedProfile(device.getMacAddress());
} }
else else
{ {
ProfilePath[i] = OlderProfilePath[i]; ProfilePath[Index] = OlderProfilePath[Index];
} }
LoadProfile(i, false, this, false, false); LoadProfile(Index, false, this, false, false);
touchPad[Index] = new Mouse(Index, device); touchPad[Index] = new Mouse(Index, device);
device.LightBarColor = getMainColor(Index); device.LightBarColor = getMainColor(Index);
device.Report += this.On_Report; device.Report += this.On_Report;