]> git.lizzy.rs Git - xdecor.git/commitdiff
Work Table : prevent cutting to different micronodes when the outputstack is already...
authorjp <jeanpatrick.guerrero@gmail.com>
Thu, 6 Aug 2015 16:08:18 +0000 (18:08 +0200)
committerjp <jeanpatrick.guerrero@gmail.com>
Thu, 6 Aug 2015 16:08:18 +0000 (18:08 +0200)
mailbox.lua
worktable.lua

index 8bf500c507bfe76e4232d44b9ccf8135a65b5605..9bd3abcc4c22201d30ed54a923c466d14787354a 100644 (file)
@@ -50,7 +50,6 @@ xdecor.register("mailbox", {
                if listname == "drop" then
                        local meta = minetest.get_meta(pos)
                        local inv = meta:get_inventory()
-
                        if inv:room_for_item("main", stack) then return -1
                        else return 0 end
                end
index 4753a520776d51867f094a59afa2d7139d87692b..3655e188c6baaa848299a3765393bdb877928048 100644 (file)
@@ -70,13 +70,16 @@ function worktable.fields(pos, formname, fields, sender)
        for _, d in pairs(def) do
                local nb, anz = d[1], d[2]
                if outputcount < 99 and fields[nb] then
+                       local outputshape = string.match(outputstack:get_name(), nb)
+                       if nb ~= outputshape and outputcount > 0 then return end
                        shape = "xdecor:"..nb.."_"..string.sub(inputname, 9)
                        get = shape.." "..anz
 
-                       if not minetest.registered_nodes[shape] then return end
-                       inv:add_item("output", get)
-                       inputstack:take_item()
-                       inv:set_stack("input", 1, inputstack)
+                       if minetest.registered_nodes[shape] then
+                               inv:add_item("output", get)
+                               inputstack:take_item()
+                               inv:set_stack("input", 1, inputstack)
+                       end
                end
        end
 end