Skip to content

Commit

Permalink
Chat commands: Trim whitespaces from input of /privs command
Browse files Browse the repository at this point in the history
  • Loading branch information
red-001 authored and paramat committed Oct 20, 2016
1 parent 91250c1 commit c7d569b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions builtin/game/chatcommands.lua
Expand Up @@ -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,
})

Expand Down

0 comments on commit c7d569b

Please sign in to comment.