diff options
author | Uberi <azhang9@gmail.com> | 2014-07-10 20:17:12 -0400 |
---|---|---|
committer | Uberi <azhang9@gmail.com> | 2014-07-10 20:17:12 -0400 |
commit | 9ec1a799d81b552dd9b3beb080ee4e2863c2d519 (patch) | |
tree | 6e1275822e7051900a7e55e6ed6e2fed58b3439d | |
parent | b70fd16da4de759f86ab2c7b21d1c50361d7351d (diff) |
Fix worldedit_gui not working in Minetest 0.4.10.
-rw-r--r-- | worldedit_gui/init.lua | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/worldedit_gui/init.lua b/worldedit_gui/init.lua index b1ebc72..3088f72 100644 --- a/worldedit_gui/init.lua +++ b/worldedit_gui/init.lua @@ -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 |