aboutsummaryrefslogtreecommitdiff
path: root/builtin/common
diff options
context:
space:
mode:
authorJude Melton-Houghton <jwmhjwmh@gmail.com>2022-11-29 18:25:47 -0500
committerGitHub <noreply@github.com>2022-11-29 18:25:47 -0500
commitda4a4086cff1c79c5d30d1bb3b7f23076f8dbd17 (patch)
tree2c59c76d5a4dae9bdd3b4849ec1e01e7584cf7e9 /builtin/common
parentaac1635bf7ab09700136a7194e8827898edbe54f (diff)
downloadminetest-da4a4086cff1c79c5d30d1bb3b7f23076f8dbd17.tar.xz
Fix /help privs checks (#13008)
Diffstat (limited to 'builtin/common')
-rw-r--r--builtin/common/information_formspecs.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/common/information_formspecs.lua b/builtin/common/information_formspecs.lua
index 1445a017c..3405263bf 100644
--- a/builtin/common/information_formspecs.lua
+++ b/builtin/common/information_formspecs.lua
@@ -22,6 +22,7 @@ local LIST_FORMSPEC_DESCRIPTION = [[
local F = core.formspec_escape
local S = core.get_translator("__builtin")
+local check_player_privs = core.check_player_privs
-- CHAT COMMANDS FORMSPEC
@@ -57,11 +58,10 @@ local function build_chatcommands_formspec(name, sel, copy)
.. "any entry in the list.").. "\n" ..
S("Double-click to copy the entry to the chat history.")
- local privs = core.get_player_privs(name)
for i, data in ipairs(mod_cmds) do
rows[#rows + 1] = COLOR_BLUE .. ",0," .. F(data[1]) .. ","
for j, cmds in ipairs(data[2]) do
- local has_priv = privs[cmds[2].privs]
+ local has_priv = check_player_privs(name, cmds[2].privs)
rows[#rows + 1] = ("%s,1,%s,%s"):format(
has_priv and COLOR_GREEN or COLOR_GRAY,
cmds[1], F(cmds[2].params))