diff options
author | Rui <Rui914@users.noreply.github.com> | 2015-09-13 12:54:18 +0900 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2016-01-05 13:33:12 +0100 |
commit | 7a19c5303bc5f39f4321143862d0f3ea244c323c (patch) | |
tree | cb013343d18498451ee6334b2b9431661aec7950 | |
parent | 35b68c481b62e0bc39260578eb68dbcde6817eb4 (diff) |
Fix undeclared global variable
-rw-r--r-- | worldedit_gui/init.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/worldedit_gui/init.lua b/worldedit_gui/init.lua index afd8c2c..da54f7b 100644 --- a/worldedit_gui/init.lua +++ b/worldedit_gui/init.lua @@ -67,7 +67,7 @@ local get_formspec = function(name, identifier) end --implement worldedit.show_page(name, page) in different ways depending on the available APIs -if unified_inventory then --unified inventory installed +if rawget(_G, "unified_inventory") then --unified inventory installed local old_func = worldedit.register_gui_function worldedit.register_gui_function = function(identifier, options) old_func(identifier, options) @@ -100,7 +100,7 @@ if unified_inventory then --unified inventory installed player:set_inventory_formspec(get_formspec(name, page)) end end -elseif inventory_plus then --inventory++ installed +elseif rawget(_G, "inventory_plus") then --inventory++ installed minetest.register_on_joinplayer(function(player) local can_worldedit = minetest.check_player_privs(player:get_player_name(), {worldedit=true}) if can_worldedit then |