Skip to content

Commit f8d3614

Browse files
committedJan 21, 2014
Make /lua and /luatransform administrator-only
1 parent 86d35e9 commit f8d3614

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed
 

‎worldedit_commands/init.lua

+12
Original file line numberDiff line numberDiff line change
@@ -1051,6 +1051,12 @@ minetest.register_chatcommand("/lua", {
10511051
description = "Executes <code> as a Lua chunk in the global namespace",
10521052
privs = {worldedit=true, server=true},
10531053
func = function(name, param)
1054+
local admin = minetest.setting_get("name")
1055+
if not admin or not name == admin then
1056+
worldedit.player_notify(name, "This command can only"
1057+
.." be run by the server administrator")
1058+
return
1059+
end
10541060
local err = worldedit.lua(param)
10551061
if err then
10561062
worldedit.player_notify(name, "code error: " .. err)
@@ -1065,6 +1071,12 @@ minetest.register_chatcommand("/luatransform", {
10651071
description = "Executes <code> as a Lua chunk in the global namespace with the variable pos available, for each node in the current WorldEdit region",
10661072
privs = {worldedit=true, server=true},
10671073
func = function(name, param)
1074+
local admin = minetest.setting_get("name")
1075+
if not admin or not name == admin then
1076+
worldedit.player_notify(name, "This command can only"
1077+
.." be run by the server administrator")
1078+
return
1079+
end
10681080
local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name]
10691081
if pos1 == nil or pos2 == nil then
10701082
worldedit.player_notify(name, "no region selected")

0 commit comments

Comments
 (0)