Bugfix
authorNovatux <nathanael.courant@laposte.net>
Sun, 18 May 2014 14:41:37 +0000 (16:41 +0200)
committerNovatux <nathanael.courant@laposte.net>
Sun, 18 May 2014 14:41:37 +0000 (16:41 +0200)
deployer.lua
item_transport.lua
node_breaker.lua

index b1b20a0178aa2736605a6d20afb8064be7e709de..cfcc794037499bd3200ea72c7eda9b8ad5edbcd6 100644 (file)
@@ -129,7 +129,10 @@ minetest.register_node("pipeworks:deployer_off", {
                        return inv:room_for_item("main",stack)
                end,
                input_inventory="main",
-               connect_sides={back=1}},
+               connect_sides={back=1},
+               can_remove = function(pos, node, stack, dir)
+                       return stack:get_count()
+               end},
        is_ground_content = true,
        paramtype2 = "facedir",
        groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2, mesecon = 2,tubedevice=1, tubedevice_receiver=1},
@@ -212,7 +215,10 @@ minetest.register_node("pipeworks:deployer_on", {
                        return inv:room_for_item("main",stack)
                end,
                input_inventory="main",
-               connect_sides={back=1}},
+               connect_sides={back=1},
+               can_remove = function(pos, node, stack, dir)
+                       return stack:get_count()
+               end},
        is_ground_content = true,
        paramtype2 = "facedir",
        tubelike=1,
index 1777ce6a50274291c3299026df8ea8f8dfb3b561..691f1314227d4ce30e0529f18ecfa46efb202c54 100644 (file)
@@ -52,7 +52,7 @@ local function grabAndFire(frominv,frominvname,frompos,fromnode,sname,tube,idef,
                        if tube.can_remove then
                                doRemove = tube.can_remove(frompos, fromnode, stack, dir)
                        elseif idef.allow_metadata_inventory_take then
-                               doRemove = idef.allow_metadata_inventory_take(frompos,"main",spos, stack, fakePlayer)
+                               doRemove = idef.allow_metadata_inventory_take(frompos, frominvname,spos, stack, fakePlayer)
                        end
                        -- stupid lack of continue statements grumble
                        if doRemove > 0 then
@@ -70,7 +70,7 @@ local function grabAndFire(frominv,frominvname,frompos,fromnode,sname,tube,idef,
                                        item = stack:take_item(count)
                                        frominv:set_stack(frominvname, spos, stack)
                                        if idef.on_metadata_inventory_take then
-                                               idef.on_metadata_inventory_take(frompos, "main", spos, item, fakePlayer)
+                                               idef.on_metadata_inventory_take(frompos, frominvname, spos, item, fakePlayer)
                                        end
                                end
                                local item1 = pipeworks.tube_item(vector.add(frompos, vector.multiply(dir, 1.4)), item)
index f0e6776335788da588a9154b83e6d41672e1bdf4..d43a54148d39a109dbf3a7841ed7a0f8e592d06c 100644 (file)
@@ -221,6 +221,9 @@ minetest.register_node("pipeworks:nodebreaker_off", {
                        local meta = minetest.get_meta(pos)
                        local inv = meta:get_inventory()
                        return inv:room_for_item("pick", stack)
+               end,
+               can_remove = function(pos, node, stack, dir)
+                       return stack:get_count()
                end},
        on_construct = function(pos)
                local meta = minetest.get_meta(pos)
@@ -316,6 +319,9 @@ minetest.register_node("pipeworks:nodebreaker_on", {
                        local meta = minetest.get_meta(pos)
                        local inv = meta:get_inventory()
                        return inv:room_for_item("pick", stack)
+               end,
+               can_remove = function(pos, node, stack, dir)
+                       return stack:get_count()
                end},
        on_construct = function(pos)
                local meta = minetest.get_meta(pos)