From 975edf644a1f098320dba7552f88a8381ff8491b Mon Sep 17 00:00:00 2001 From: Aptivi CEO Date: Tue, 31 Dec 2024 15:53:43 +0300 Subject: [PATCH] imp - Fixed infinite loop of method adding --- In the inter-addon and inter-mod communication, we've fixed populating a list of callable functions. This makes sure that we never enter into a state of infinite looping caused by checking the wrong variable. --- Type: imp Breaking: False Doc Required: False Backport Required: False Part: 1/1 --- public/Nitrocid/Kernel/Extensions/InterAddonTools.cs | 2 +- public/Nitrocid/Modifications/Communication/InterModTools.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/Nitrocid/Kernel/Extensions/InterAddonTools.cs b/public/Nitrocid/Kernel/Extensions/InterAddonTools.cs index bf841b451..c68a02d25 100644 --- a/public/Nitrocid/Kernel/Extensions/InterAddonTools.cs +++ b/public/Nitrocid/Kernel/Extensions/InterAddonTools.cs @@ -140,7 +140,7 @@ public static Dictionary ListAvailableFunctions(string addon // Make sure that overloaded methods that have the same name don't conflict with another method int iter = 1; - while (functions.ContainsKey(name)) + while (functions.ContainsKey(finalName)) { iter++; finalName = name + iter; diff --git a/public/Nitrocid/Modifications/Communication/InterModTools.cs b/public/Nitrocid/Modifications/Communication/InterModTools.cs index 40f2829bd..536bbe5a1 100644 --- a/public/Nitrocid/Modifications/Communication/InterModTools.cs +++ b/public/Nitrocid/Modifications/Communication/InterModTools.cs @@ -101,7 +101,7 @@ public static Dictionary ListAvailableFunctions(string modNa // Make sure that overloaded methods that have the same name don't conflict with another method int iter = 1; - while (functions.ContainsKey(name)) + while (functions.ContainsKey(finalName)) { iter++; finalName = name + iter;