ensure params are strings when invoking scripts

develop
myk002 2022-09-10 10:10:28 -07:00
parent cae2bca0a7
commit 3c99a7214f
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
1 changed files with 5 additions and 1 deletions

@ -789,7 +789,11 @@ function dfhack.run_script_with_env(envVars, name, flags, ...)
end
scripts[file].env = env
scripts[file].run = script_code
return script_code(...), env
local args = {...}
for i,v in ipairs(args) do
args[i] = tostring(v) -- ensure passed parameters are strings
end
return script_code(table.unpack(args)), env
end
function dfhack.current_script_name()