Skip unsupported Lighting modes #3195

This commit is contained in:
Serge
2024-09-30 20:58:24 +02:00
parent 73d5a0bb90
commit 873fcc0591

View File

@@ -326,13 +326,8 @@ namespace GHelper
return; return;
} }
if (comboBoxLightingMode.SelectedIndex >= supportedLightingModes.Count) var index = comboBoxLightingMode.SelectedIndex;
{ LightingMode lm = supportedLightingModes[index < supportedLightingModes.Count ? index : 0 ];
// Unsupported mode
return;
}
LightingMode lm = supportedLightingModes[comboBoxLightingMode.SelectedIndex];
LightingSetting? ls = mouse.LightingSettingForZone(visibleZone); LightingSetting? ls = mouse.LightingSettingForZone(visibleZone);
if (ls.LightingMode == lm) if (ls.LightingMode == lm)