diff options
author | red-001 <red-001@openmailbox.org> | 2016-09-26 19:07:52 +0100 |
---|---|---|
committer | paramat <mat.gregory@virginmedia.com> | 2016-10-20 03:39:03 +0100 |
commit | c7d569b8636d8046393715e46fca40e58138183f (patch) | |
tree | 2840e9188098ca3a283925c6b9bebb01e6ac0b94 | |
parent | 91250c1078dc5dc5f48bba2b309920edd6cdfe68 (diff) | |
download | minetest-c7d569b8636d8046393715e46fca40e58138183f.tar.gz minetest-c7d569b8636d8046393715e46fca40e58138183f.tar.bz2 minetest-c7d569b8636d8046393715e46fca40e58138183f.zip |
Chat commands: Trim whitespaces from input of `/privs` command
-rw-r--r-- | builtin/game/chatcommands.lua | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/builtin/game/chatcommands.lua b/builtin/game/chatcommands.lua index d8fee1578..2bd93855b 100644 --- a/builtin/game/chatcommands.lua +++ b/builtin/game/chatcommands.lua @@ -147,11 +147,12 @@ core.register_chatcommand("help", { core.register_chatcommand("privs", { params = "<name>", description = "print out privileges of player", - func = function(name, param) - param = (param ~= "" and param or name) - return true, "Privileges of " .. param .. ": " + func = function(caller, param) + param = param:trim() + local name = (param ~= "" and param or caller) + return true, "Privileges of " .. name .. ": " .. core.privs_to_string( - core.get_player_privs(param), ' ') + core.get_player_privs(name), ' ') end, }) |