summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNovatux <nathanael.courant@laposte.net>2014-05-18 16:41:37 +0200
committerNovatux <nathanael.courant@laposte.net>2014-05-18 16:41:37 +0200
commit8efcd39e39c6ddafc36423f4627ddbb38b5988b7 (patch)
treeca7c72b6791e1954aa7eef7ec6c5030a295de1bc
parent3f72bbf3d0788fbe4f0af7348a9e41f575fe81e3 (diff)
downloadpipeworks-8efcd39e39c6ddafc36423f4627ddbb38b5988b7.tar
pipeworks-8efcd39e39c6ddafc36423f4627ddbb38b5988b7.tar.gz
pipeworks-8efcd39e39c6ddafc36423f4627ddbb38b5988b7.tar.bz2
pipeworks-8efcd39e39c6ddafc36423f4627ddbb38b5988b7.tar.xz
pipeworks-8efcd39e39c6ddafc36423f4627ddbb38b5988b7.zip
Bugfix
-rw-r--r--deployer.lua10
-rw-r--r--item_transport.lua4
-rw-r--r--node_breaker.lua6
3 files changed, 16 insertions, 4 deletions
diff --git a/deployer.lua b/deployer.lua
index b1b20a0..cfcc794 100644
--- a/deployer.lua
+++ b/deployer.lua
@@ -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,
diff --git a/item_transport.lua b/item_transport.lua
index 1777ce6..691f131 100644
--- a/item_transport.lua
+++ b/item_transport.lua
@@ -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)
diff --git a/node_breaker.lua b/node_breaker.lua
index f0e6776..d43a541 100644
--- a/node_breaker.lua
+++ b/node_breaker.lua
@@ -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)