From 8366adbbb0c5c9ec47ae32fd613a7ac737b5091d Mon Sep 17 00:00:00 2001 From: Darth Affe Date: Mon, 19 Apr 2021 19:43:28 +0200 Subject: [PATCH] Fixed wrong loop condition in corsair custom devices --- RGB.NET.Devices.Corsair/Custom/CorsairCustomRGBDevice.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RGB.NET.Devices.Corsair/Custom/CorsairCustomRGBDevice.cs b/RGB.NET.Devices.Corsair/Custom/CorsairCustomRGBDevice.cs index d534d2b..5deab5c 100644 --- a/RGB.NET.Devices.Corsair/Custom/CorsairCustomRGBDevice.cs +++ b/RGB.NET.Devices.Corsair/Custom/CorsairCustomRGBDevice.cs @@ -41,7 +41,7 @@ namespace RGB.NET.Devices.Corsair IntPtr ptr = new(nativeLedPositions.pLedPosition.ToInt64() + (structSize * DeviceInfo.LedOffset)); LedId referenceLedId = GetReferenceLed(DeviceInfo.DeviceType); - for (int i = 0; i < nativeLedPositions.numberOfLed; i++) + for (int i = 0; i < DeviceInfo.LedCount; i++) { LedId ledId = referenceLedId + i; _CorsairLedPosition? ledPosition = (_CorsairLedPosition?)Marshal.PtrToStructure(ptr, typeof(_CorsairLedPosition)); @@ -59,7 +59,7 @@ namespace RGB.NET.Devices.Corsair ptr = new IntPtr(ptr.ToInt64() + structSize); } } - + private static LedId GetReferenceLed(RGBDeviceType deviceType) => deviceType switch {