summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNovatux <nathanael.courant@laposte.net>2013-10-21 11:34:10 +0200
committerNovatux <nathanael.courant@laposte.net>2013-10-21 11:34:10 +0200
commit12eb772d18a4fef809e025751d813a6a514f8821 (patch)
treeaac39fcd5b32777c9ed55b6a4929bfad0339ba16
parent6eaf8eac622276915160b1a0220086974d47bcc0 (diff)
downloadpipeworks-12eb772d18a4fef809e025751d813a6a514f8821.tar
pipeworks-12eb772d18a4fef809e025751d813a6a514f8821.tar.gz
pipeworks-12eb772d18a4fef809e025751d813a6a514f8821.tar.bz2
pipeworks-12eb772d18a4fef809e025751d813a6a514f8821.tar.xz
pipeworks-12eb772d18a4fef809e025751d813a6a514f8821.zip
Fix crossing tube and one way tube.
-rw-r--r--item_transport.lua2
-rw-r--r--tubes.lua4
2 files changed, 3 insertions, 3 deletions
diff --git a/item_transport.lua b/item_transport.lua
index 721aa19..3e7ff0a 100644
--- a/item_transport.lua
+++ b/item_transport.lua
@@ -394,7 +394,7 @@ minetest.register_entity("pipeworks:tubed_item", {
local moved=false
local speed=math.abs(velocity.x+velocity.y+velocity.z)
- local vel={x=velocity.x/speed,y=velocity.y/speed,z=velocity.z/speed}
+ local vel={x=velocity.x/speed,y=velocity.y/speed,z=velocity.z/speed, speed=speed}
if math.abs(vel.x)==1 then
local next_node=math.abs(pos.x-self.start_pos.x)
diff --git a/tubes.lua b/tubes.lua
index 7056c4b..7ac950e 100644
--- a/tubes.lua
+++ b/tubes.lua
@@ -477,7 +477,7 @@ if enable_crossing_tube then
register_tube("pipeworks:crossing_tube","Crossing tube segment",accelerator_plain_textures,
accelerator_noctr_textures,accelerator_end_textures,accelerator_short_texture,accelerator_inv_texture,
{tube={can_go=function(pos,node,velocity,stack)
- return velocity
+ return {velocity}
end}
})
end
@@ -640,7 +640,7 @@ if enable_one_way_tube then
insert_object = function(pos,node,stack,direction)
item1=tube_item(pos,stack)
item1:get_luaentity().start_pos = pos
- item1:setvelocity(direction)
+ item1:setvelocity({x=direction.x*direction.speed, y=direction.y*direction.speed, z=direction.z*direction.speed})
item1:setacceleration({x=0, y=0, z=0})
return ItemStack("")
end,