summaryrefslogtreecommitdiff
path: root/builtin/game
diff options
context:
space:
mode:
authorClobberXD <ClobberXD@gmail.com>2018-07-16 18:25:04 +0530
committerLoïc Blot <nerzhul@users.noreply.github.com>2018-07-16 14:55:03 +0200
commita0635f602487944d25c03efecee61cecf3bdb5ab (patch)
treea7a06628ef9abc7240303c1bae367610d540c91e /builtin/game
parent1aaee5b30d2c28e3256a0c8c3fc3784af91fb21b (diff)
downloadminetest-a0635f602487944d25c03efecee61cecf3bdb5ab.tar.gz
minetest-a0635f602487944d25c03efecee61cecf3bdb5ab.tar.bz2
minetest-a0635f602487944d25c03efecee61cecf3bdb5ab.zip
Check if player exists on use of /privs (#7554)
* /privs: Check if player exists
Diffstat (limited to 'builtin/game')
-rw-r--r--builtin/game/chatcommands.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/builtin/game/chatcommands.lua b/builtin/game/chatcommands.lua
index 4aef063de..985670572 100644
--- a/builtin/game/chatcommands.lua
+++ b/builtin/game/chatcommands.lua
@@ -84,7 +84,7 @@ core.register_chatcommand("admin", {
func = function(name)
local admin = core.settings:get("name")
if admin then
- return true, "The administrator of this server is "..admin.."."
+ return true, "The administrator of this server is " .. admin .. "."
else
return false, "There's no administrator named in the config file."
end
@@ -97,6 +97,9 @@ core.register_chatcommand("privs", {
func = function(caller, param)
param = param:trim()
local name = (param ~= "" and param or caller)
+ if not core.player_exists(name) then
+ return false, "Player " .. name .. " does not exist."
+ end
return true, "Privileges of " .. name .. ": "
.. core.privs_to_string(
core.get_player_privs(name), ' ')