Skip to content

Commit

Permalink
Fix worldedit_gui not working in Minetest 0.4.10.
Browse files Browse the repository at this point in the history
  • Loading branch information
Uberi committed Jul 11, 2014
1 parent b70fd16 commit 9ec1a79
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions worldedit_gui/init.lua
Expand Up @@ -37,14 +37,13 @@ Example:
]]

worldedit.register_gui_handler = function(identifier, handler)
local enabled = true
minetest.register_on_player_receive_fields(function(player, formname, fields)
--ensure the form is not being exited since this is a duplicate message
if fields.quit then
return false
end

if not enabled then return false end
enabled = false
minetest.after(0.2, function() enabled = true end)
local name = player:get_player_name()

--ensure the player has permission to perform the action
local entry = worldedit.pages[identifier]
if entry and minetest.check_player_privs(name, entry.privs or {}) then
Expand Down

0 comments on commit 9ec1a79

Please sign in to comment.