From bb566b9571b532e7e530b295c3c0f77ea4479715 Mon Sep 17 00:00:00 2001 From: Aeroluna Date: Sun, 20 Nov 2022 18:23:10 -0700 Subject: [PATCH] fix log spam --- Chroma/Lighting/LightIDTableManager.cs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Chroma/Lighting/LightIDTableManager.cs b/Chroma/Lighting/LightIDTableManager.cs index 47241eea..eb94f7a6 100644 --- a/Chroma/Lighting/LightIDTableManager.cs +++ b/Chroma/Lighting/LightIDTableManager.cs @@ -140,19 +140,21 @@ internal static void UnregisterIndex(int lightID, int index) { foreach ((int key, int value) in dictioanry) { - if (value == index) + if (value != index) { - dictioanry.Remove(key); - if (ChromaConfig.Instance.PrintEnvironmentEnhancementDebug) - { - Log.Logger.Log($"Unregistered key [{key}] from light ID [{lightID}]."); - } + continue; + } - return; + dictioanry.Remove(key); + if (ChromaConfig.Instance.PrintEnvironmentEnhancementDebug) + { + Log.Logger.Log($"Unregistered key [{key}] from light ID [{lightID}]."); } - Log.Logger.Log("Could not find key to unregister.", Logger.Level.Warning); + return; } + + Log.Logger.Log("Could not find key to unregister.", Logger.Level.Warning); } else {