]> git.lizzy.rs Git - worldedit.git/commitdiff
Fix undeclared global variable
authorRui <Rui914@users.noreply.github.com>
Sun, 13 Sep 2015 03:54:18 +0000 (12:54 +0900)
committersfan5 <sfan5@live.de>
Tue, 5 Jan 2016 12:33:12 +0000 (13:33 +0100)
worldedit_gui/init.lua

index afd8c2c20c38e2ac2f272b3804b296ee7fc23f95..da54f7b4f668747b7ce9f6def79761477d47f945 100644 (file)
@@ -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