diff options
author | Tim Myers <temyers240@gmail.com> | 2019-09-18 17:37:56 -0500 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2019-09-19 00:37:56 +0200 |
commit | c413eeb0260e143ada3f2c1915bda07602e06fa1 (patch) | |
tree | 6acca75a0a2a4b301789655ce23545a7733fb37c /builtin/common/information_formspecs.lua | |
parent | 6a7f5c09852e06b2204cda67583de84e895fb78a (diff) | |
download | minetest-c413eeb0260e143ada3f2c1915bda07602e06fa1.tar.gz minetest-c413eeb0260e143ada3f2c1915bda07602e06fa1.tar.bz2 minetest-c413eeb0260e143ada3f2c1915bda07602e06fa1.zip |
Also print help commands to chat for server terminal (#8869)
Diffstat (limited to 'builtin/common/information_formspecs.lua')
-rw-r--r-- | builtin/common/information_formspecs.lua | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/builtin/common/information_formspecs.lua b/builtin/common/information_formspecs.lua index 10fe37b8f..b977e2656 100644 --- a/builtin/common/information_formspecs.lua +++ b/builtin/common/information_formspecs.lua @@ -81,7 +81,7 @@ local function build_chatcommands_formspec(name, sel, copy) end --- PRIVILEGES FORMSPEC +-- PRIVILEGES FORMSPEC local function build_privs_formspec(name) local privs = {} @@ -128,15 +128,23 @@ local help_command = core.registered_chatcommands["help"] local old_help_func = help_command.func help_command.func = function(name, param) + local admin = core.settings:get("name") + + -- If the admin ran help, put the output in the chat buffer as well to + -- work with the server terminal if param == "privs" then core.show_formspec(name, "__builtin:help_privs", build_privs_formspec(name)) - return + if name ~= admin then + return + end end if param == "" or param == "all" then core.show_formspec(name, "__builtin:help_cmds", build_chatcommands_formspec(name)) - return + if name ~= admin then + return + end end return old_help_func(name, param) |