fix(callChatCmd): callChatCmd func can not work if params is table

master
Riceball LEE 2021-06-20 21:27:36 +08:00
parent a85fe81653
commit b113503f0c
No known key found for this signature in database
GPG Key ID: 10F15E84852CB868
1 changed files with 3 additions and 2 deletions

View File

@ -6,14 +6,15 @@ local function callChatCmd(cmdStr, playerName, params)
local paramsType = type(params)
if (params == nil or paramsType == "string") then
return cmd.func(playerName, params)
elseif paramsType ~= "table" then
elseif paramsType == "table" then
-- if paramsType ~= "table" then
-- params = {playerName}
-- else
-- table.insert(params, 1, playerName)
-- end
return cmd.func(playerName, table.concat(params, " "))
params = table.concat(params, " ")
return cmd.func(playerName, params)
end
else
minetest.log("warning", "callChatCmd: No such chat command:" .. cmdStr)