1
0
mirror of https://github.com/mt-mods/pipeworks.git synced 2024-12-26 19:00:24 +01:00

item_transport.lua: move tube limit checking before can_go() callback in go_next()

This commit is contained in:
thetaepsilon-gamedev 2017-12-19 18:17:22 +00:00
parent 56362cdd2a
commit 755dd26208

View File

@ -89,6 +89,9 @@ local function go_next(pos, velocity, stack, owner)
speed = 1 speed = 1
end end
vel.speed = speed vel.speed = speed
crunch_tube(pos, cnode, cmeta)
if minetest.registered_nodes[cnode.name] and minetest.registered_nodes[cnode.name].tube and minetest.registered_nodes[cnode.name].tube.can_go then if minetest.registered_nodes[cnode.name] and minetest.registered_nodes[cnode.name].tube and minetest.registered_nodes[cnode.name].tube.can_go then
can_go = minetest.registered_nodes[cnode.name].tube.can_go(pos, cnode, vel, stack) can_go = minetest.registered_nodes[cnode.name].tube.can_go(pos, cnode, vel, stack)
else else
@ -116,8 +119,6 @@ local function go_next(pos, velocity, stack, owner)
end end
end end
crunch_tube(pos, cnode, cmeta)
if not next_positions[1] then if not next_positions[1] then
return false, nil return false, nil
end end