diff options
author | Anthony <azhang9@gmail.com> | 2013-12-22 09:52:17 -0800 |
---|---|---|
committer | Anthony <azhang9@gmail.com> | 2013-12-22 09:52:17 -0800 |
commit | 4e78ced6934ece05c9202fecea7418d0d233ed1b (patch) | |
tree | afee435ca94e83d32a26011c89b23ae49dd648f7 /worldedit_gui/init.lua | |
parent | 06cb2934b1e4f08fc082b2a4ca9f594eea5fb9a8 (diff) | |
parent | ad299cacc51d1a517f8e5eb58e5aa1888d4f0955 (diff) |
Merge pull request #26 from kaeza/wut
Fix crashes in GUI button.
Diffstat (limited to 'worldedit_gui/init.lua')
-rw-r--r-- | worldedit_gui/init.lua | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/worldedit_gui/init.lua b/worldedit_gui/init.lua index 16a80af..d1be200 100644 --- a/worldedit_gui/init.lua +++ b/worldedit_gui/init.lua @@ -72,7 +72,7 @@ if unified_inventory then local old_func = worldedit.register_gui_function worldedit.register_gui_function = function(identifier, options) old_func(identifier, options) - unified_inventory.register_page(identifier, {get_formspec=function(player) return {formspec=options.get_formspec(player:get_player_by_name())} end}) + unified_inventory.register_page(identifier, {get_formspec=function(player) return {formspec=options.get_formspec(player:get_player_name())} end}) end unified_inventory.register_button("worldedit_gui", { @@ -81,6 +81,7 @@ if unified_inventory then }) minetest.register_on_player_receive_fields(function(player, formname, fields) + local name = player:get_player_name() if fields.worldedit_gui_exit then unified_inventory.set_inventory_formspec(minetest.get_player_by_name(name), "craft") return true |