Skip to content

Commit c7d569b

Browse files
red-001paramat
authored andcommittedOct 20, 2016
Chat commands: Trim whitespaces from input of /privs command
1 parent 91250c1 commit c7d569b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed
 

‎builtin/game/chatcommands.lua

+5-4
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,12 @@ core.register_chatcommand("help", {
147147
core.register_chatcommand("privs", {
148148
params = "<name>",
149149
description = "print out privileges of player",
150-
func = function(name, param)
151-
param = (param ~= "" and param or name)
152-
return true, "Privileges of " .. param .. ": "
150+
func = function(caller, param)
151+
param = param:trim()
152+
local name = (param ~= "" and param or caller)
153+
return true, "Privileges of " .. name .. ": "
153154
.. core.privs_to_string(
154-
core.get_player_privs(param), ' ')
155+
core.get_player_privs(name), ' ')
155156
end,
156157
})
157158

0 commit comments

Comments
 (0)
Please sign in to comment.