bw - fix multiple variables not loaded in LUA

This commit is contained in:
bunkerity 2023-06-14 15:32:36 +02:00
parent 236572f581
commit b14dba7752
1 changed files with 4 additions and 4 deletions

View File

@ -245,13 +245,13 @@ function helpers.load_variables(all_variables, plugins)
end
if data.multiple then
for variable, value in pairs(all_variables) do
local found, _, prefix = variable:find("^([^_]*)_?" .. variable .. "_[0-9]+$")
local found, _, prefix = variable:find("^([^_]*)_?" .. setting .. "_[0-9]+$")
if found then
if multisite and prefix then
variables[prefix][setting] = value
if multisite and prefix and prefix ~= "" then
variables[prefix][variable] = value
break
end
variables["global"][setting] = prefix
variables["global"][variable] = value
break
end
end