File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ -- mods/default/chat.lua
2+
3+ local function match_old (privs )
4+ local ok = false
5+ for k , v in pairs (privs ) do
6+ if k == " give" and v then
7+ ok = true
8+ elseif v then
9+ return false
10+ end
11+ end
12+ return ok
13+ end
14+
15+ -- Change /pulverize and /clearinv to not require give, like it used to be
16+ -- before Luanti 5.15
17+ for _ , cmd in ipairs ({" pulverize" , " clearinv" }) do
18+ local def = core .registered_chatcommands [cmd ]
19+ if def and def .privs then
20+ if match_old (def .privs ) then
21+ def .privs = {}
22+ else
23+ minetest .log (" info" , " Privileges of command /" .. cmd .. " look modified, not overriding them." )
24+ end
25+ end
26+ end
Original file line number Diff line number Diff line change @@ -75,6 +75,7 @@ dofile(default_path.."/item_entity.lua")
7575dofile (default_path .. " /craftitems.lua" )
7676dofile (default_path .. " /crafting.lua" )
7777dofile (default_path .. " /mapgen.lua" )
78+ dofile (default_path .. " /chat.lua" )
7879dofile (default_path .. " /aliases.lua" )
7980dofile (default_path .. " /legacy.lua" )
8081
You can’t perform that action at this time.
0 commit comments