From 1e6ba05a9ecf5f57fcef48f8bb3dc066bfea063d Mon Sep 17 00:00:00 2001 From: Proddy Date: Sun, 28 Aug 2022 11:52:56 +0100 Subject: [PATCH] Update ModuleLoader.lua * Improve priority table creation --- Randomiser/Resources/lib/ModuleLoader.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Randomiser/Resources/lib/ModuleLoader.lua b/Randomiser/Resources/lib/ModuleLoader.lua index d493c82..335009e 100644 --- a/Randomiser/Resources/lib/ModuleLoader.lua +++ b/Randomiser/Resources/lib/ModuleLoader.lua @@ -19,9 +19,12 @@ for i=1,#ModuleFiles do if result.Setting == nil or Settings[result.Setting] then local priority = result.Priority or 5 - local modules = Modules[priority] or {} + local modules = Modules[priority] + if modules == nil then + modules = {} + Modules[priority] = modules + end modules[#modules + 1] = result - Modules[priority] = modules ModulesN = ModulesN + 1 end end