From 3ca50d78f3d40afe5295c02a66b0202bd2e5d1ca Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sun, 28 Sep 2025 18:15:24 +0200 Subject: [PATCH] Require 'give' priv for /pulverize and /clearinv --- builtin/game/chat.lua | 2 ++ builtin/game/privileges.lua | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/builtin/game/chat.lua b/builtin/game/chat.lua index 80c9a6e812..c143f304b9 100644 --- a/builtin/game/chat.lua +++ b/builtin/game/chat.lua @@ -902,6 +902,7 @@ core.register_chatcommand("spawnentity", { core.register_chatcommand("pulverize", { params = "", description = S("Destroy item in hand"), + privs = {give=true}, func = function(name, param) local player = core.get_player_by_name(name) if not player then @@ -1302,6 +1303,7 @@ core.register_chatcommand("last-login", { core.register_chatcommand("clearinv", { params = S("[]"), description = S("Clear the inventory of yourself or another player"), + privs = {give=true}, func = function(name, param) local player if param and param ~= "" and param ~= name then diff --git a/builtin/game/privileges.lua b/builtin/game/privileges.lua index b2eadd36b3..1ee0969aee 100644 --- a/builtin/game/privileges.lua +++ b/builtin/game/privileges.lua @@ -71,7 +71,7 @@ core.register_privilege("kick", { give_to_admin = true, }) core.register_privilege("give", { - description = S("Can use /give and /giveme"), + description = S("Can use /give, /giveme, /pulverize and /clearinv"), give_to_singleplayer = false, }) core.register_privilege("password", {