]> git.lizzy.rs Git - xdecor.git/commitdiff
Mailbox : prevent digging if inv ain't empty
authorjp <jeanpatrick.guerrero@gmail.com>
Thu, 6 Aug 2015 18:22:44 +0000 (20:22 +0200)
committerjp <jeanpatrick.guerrero@gmail.com>
Thu, 6 Aug 2015 18:22:44 +0000 (20:22 +0200)
mailbox.lua

index 9bd3abcc4c22201d30ed54a923c466d14787354a..a39030185717fbf17d30de5b45262ffb1affd5c3 100644 (file)
@@ -34,7 +34,8 @@ xdecor.register("mailbox", {
                local owner = meta:get_string("owner")
                local inv = meta:get_inventory()
 
-               return player:get_player_name() == owner and inv:is_empty("main")
+               if not inv:is_empty("main") then return false end
+               return player:get_player_name() == owner
        end,
        on_metadata_inventory_put = function(pos, listname, index, stack, player)
                local meta = minetest.get_meta(pos)