Prevent items from leaving below filters
authorNovatux <nathanael.courant@laposte.net>
Fri, 10 Jan 2014 20:26:14 +0000 (21:26 +0100)
committerNovatux <nathanael.courant@laposte.net>
Fri, 10 Jan 2014 20:26:14 +0000 (21:26 +0100)
item_transport.lua

index af5a8176bcac6221cace3e5cce1d4f631aabd15a..e67ef35fa50676b9ffa89ce94265ca17f176029b 100644 (file)
@@ -73,8 +73,8 @@ local function grabAndFire(frominv,frominvname,frompos,fromnode,sname,tube,idef,
                                                idef.on_metadata_inventory_take(frompos, "main", spos, item, fakePlayer)
                                        end
                                end
-                               local item1 = pipeworks.tube_item(frompos, item)
-                               item1:get_luaentity().start_pos = frompos
+                               local item1 = pipeworks.tube_item(vector.add(frompos, vector.multiply(dir, 1.4)), item)
+                               item1:get_luaentity().start_pos = vector.add(frompos, dir)
                                item1:setvelocity(dir)
                                item1:setacceleration({x=0, y=0, z=0})
                                return true-- only fire one item, please
@@ -142,8 +142,8 @@ minetest.register_node("pipeworks:filter", {
                        end
                end
                if inv:is_empty("main") then
-               grabAndFire(frominv,frominvname,frompos,fromnode,nil,tube,idef,dir)
-                       end
+                       grabAndFire(frominv,frominvname,frompos,fromnode,nil,tube,idef,dir)
+               end
        end,
 })