diff options
author | Diego Martinez <kaeza@users.sf.net> | 2015-01-22 10:52:17 -0300 |
---|---|---|
committer | Vanessa Ezekowitz <vanessaezekowitz@gmail.com> | 2015-01-22 11:18:23 -0500 |
commit | 9493478e594c951cd9349721aa836e242e318026 (patch) | |
tree | 76cd9e54351883b12aff2cfa7fd453fe89fa3763 | |
parent | 82a7b6a749a4ab452325f1ac448cf041ac41e6be (diff) | |
download | pipeworks-9493478e594c951cd9349721aa836e242e318026.tar pipeworks-9493478e594c951cd9349721aa836e242e318026.tar.gz pipeworks-9493478e594c951cd9349721aa836e242e318026.tar.bz2 pipeworks-9493478e594c951cd9349721aa836e242e318026.tar.xz pipeworks-9493478e594c951cd9349721aa836e242e318026.zip |
Fix tubes only taking a single designated path.
-rwxr-xr-x | tubes.lua | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -271,11 +271,11 @@ if pipeworks.enable_mese_tube then fs_helpers.cycling_button(meta, "button[7,5;1,1", "l6s", {"Off", "On"}).. "list[current_player;main;0,7;8,4;]") end - local os_clock = os.clock pipeworks.register_tube("pipeworks:mese_tube", "Sorting Pneumatic Tube Segment", mese_plain_textures, mese_noctr_textures, mese_end_textures, mese_short_texture, mese_inv_texture, {tube = {can_go = function(pos, node, velocity, stack) local tbl, tbln = {}, 0 + local found, foundn = {}, 0 local meta = minetest.get_meta(pos) local inv = meta:get_inventory() local name = stack:get_name() @@ -287,7 +287,8 @@ if pipeworks.enable_mese_tube then if not st:is_empty() then is_empty = false if st:get_name() == name then - return { vect } + foundn = foundn + 1 + found[foundn] = vect end end end @@ -297,7 +298,7 @@ if pipeworks.enable_mese_tube then end end end - return tbl + return (foundn > 0) and found or tbl end}, on_construct = function(pos) local meta = minetest.get_meta(pos) |