~fgaz/minetest-extruder

80d5145df5e5707af39d1862c5b9e2b4a246c1b9 — Francesco Gazzetta 1 year, 4 months ago 476341a
Check privs on form submission
1 files changed, 2 insertions(+), 0 deletions(-)

M init.lua
M init.lua => init.lua +2 -0
@@ 120,6 120,8 @@ minetest.register_tool(modname .. ":extruder", {

minetest.register_on_player_receive_fields(function(player, formname, fields)
  if formname ~= (modname .. ":settings") then return end
  if player == nil then return end
  if not lib.check_privs_with_msg(player, "extruder") then return end

  local inventory = player:get_inventory()
  local wield_index = player:get_wield_index()