1
0
mirror of https://github.com/Uberi/Minetest-WorldEdit.git synced 2025-07-04 00:51:04 +02:00

Run worldedit.privs inside and outside of worldedit.can_edit_volume

Never run worldedit.can_edit_volume without worldedit.privs surrounding
it
This commit is contained in:
khonkhortisan
2014-04-18 16:52:34 -07:00
parent 4b80eb82cc
commit 88e4c635aa
2 changed files with 50 additions and 19 deletions

View File

@ -291,9 +291,11 @@ minetest.register_chatcommand("/set", {
privs = {},
func = worldedit.privs(safe_region(function(name, param)
local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name]
local node = get_node(name, param)
local count = worldedit.set(pos1, pos2, node)
worldedit.player_notify(name, count .. " nodes set")
if worldedit.can_edit_volume(area:iterp(pos1, pos2)) then
local node = get_node(name, param)
local count = worldedit.set(pos1, pos2, node)
worldedit.player_notify(name, count .. " nodes set")
end
end, check_set)),
})