summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNovatux <nathanael.courant@laposte.net>2013-12-24 08:29:33 -0500
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2013-12-24 08:36:19 -0500
commitb040fc585b4c6dedf7fae677854b53f8208d30c0 (patch)
tree31a55621e831d5bdeccc1ea4af3352ccf7f70e75
parent10cf11e008ad0da51349b175dee7cc23ea951db4 (diff)
downloadpipeworks-b040fc585b4c6dedf7fae677854b53f8208d30c0.tar
pipeworks-b040fc585b4c6dedf7fae677854b53f8208d30c0.tar.gz
pipeworks-b040fc585b4c6dedf7fae677854b53f8208d30c0.tar.bz2
pipeworks-b040fc585b4c6dedf7fae677854b53f8208d30c0.tar.xz
pipeworks-b040fc585b4c6dedf7fae677854b53f8208d30c0.zip
fix filters and mese filters not working correctly
-rw-r--r--item_transport.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/item_transport.lua b/item_transport.lua
index aa91a4a..a3774ae 100644
--- a/item_transport.lua
+++ b/item_transport.lua
@@ -77,10 +77,11 @@ local function grabAndFire(frominv,frominvname,frompos,fromnode,sname,tube,idef,
item1:get_luaentity().start_pos = frompos
item1:setvelocity(dir)
item1:setacceleration({x=0, y=0, z=0})
- return -- only fire one item, please
+ return true-- only fire one item, please
end
end
end
+ return false
end
minetest.register_node("pipeworks:filter", {
@@ -137,7 +138,7 @@ minetest.register_node("pipeworks:filter", {
sname = filter:get_name()
if sname ~= "" then
-- XXX: that's a lot of parameters
- grabAndFire(frominv, frominvname, frompos, fromnode, sname, tube, idef, dir)
+ if grabAndFire(frominv, frominvname, frompos, fromnode, sname, tube, idef, dir) then return end
end
end
if inv:is_empty("main") then
@@ -203,11 +204,11 @@ minetest.register_node("pipeworks:mese_filter", {
for _,filter in ipairs(inv:get_list("main")) do
sname = filter:get_name()
if sname ~= "" then
- grabAndFire(frominv, frominvname, frompos, fromnode, sname, tube, idef, dir, true)
+ if grabAndFire(frominv, frominvname, frompos, fromnode, sname, tube, idef, dir, true) then return end
end
end
if inv:is_empty("main") then
- grabAndFire(frominv, frominvname, frompos, fromnode, sname, tube, idef, dir, true)
+ grabAndFire(frominv, frominvname, frompos, fromnode, nil, tube, idef, dir, true)
end
end,
})