Fix so string meta can be set with whitespace

master
Jordan Irwin 2021-04-29 15:56:38 -07:00
parent 6d6c2fd9a1
commit 74af86f346
1 changed files with 8 additions and 1 deletions

View File

@ -96,7 +96,14 @@ core.register_chatcommand("setmeta", {
elseif vtype == "float" then
retval = alternode.set_float(pos, key, tonumber(value))
elseif vtype == "string" then
retval = alternode.set(pos, key, value)
local rem = {}
for idx, word in ipairs(plist) do
if idx > 5 then
table.insert(rem, word)
end
end
retval = alternode.set(pos, key, table.concat(rem, " "))
else
core.chat_send_player(player,
"Unknown meta data type: " .. vtype)