Merge pull request #2280 from myk002/myk_stringify

[dfhack.run_script] pass args as strings when invoking scripts
develop
Myk 2022-09-10 10:23:30 -07:00 committed by GitHub
commit fcd273b861
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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()