1
0
mirror of https://github.com/mt-mods/pipeworks.git synced 2024-12-25 18:30:23 +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
end
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
can_go = minetest.registered_nodes[cnode.name].tube.can_go(pos, cnode, vel, stack)
else
@ -116,8 +119,6 @@ local function go_next(pos, velocity, stack, owner)
end
end
crunch_tube(pos, cnode, cmeta)
if not next_positions[1] then
return false, nil
end