Fix [clear_variable] not working on a variable name that happens to be a number

This commit is contained in:
Celtic Minstrel 2023-05-09 23:10:26 -04:00
parent e4b4b1c6ce
commit d4adbdcf91

View file

@ -107,7 +107,7 @@ function wml_actions.clear_variable(cfg, variables)
local names = cfg.name or
wml.error "[clear_variable] missing required name= attribute."
if variables == nil then variables = wml.variables end
for _,w in ipairs(names:split()) do
for _,w in ipairs(tostring(names):split()) do
variables[w:trim()] = nil
end
end