summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim <t4im@users.noreply.github.com>2016-08-29 18:28:24 +0200
committerTim <t4im@users.noreply.github.com>2016-08-29 18:28:24 +0200
commitaba1ce5b36393878dff35c5a3fe37dc8aa6ca474 (patch)
tree1a0e54ae97bf4305b4a582ecfb2012499a33d7d7
parenta65eaa7cf2b730ae1db2285a9ea354de4d598497 (diff)
downloadpipeworks-aba1ce5b36393878dff35c5a3fe37dc8aa6ca474.tar
pipeworks-aba1ce5b36393878dff35c5a3fe37dc8aa6ca474.tar.gz
pipeworks-aba1ce5b36393878dff35c5a3fe37dc8aa6ca474.tar.bz2
pipeworks-aba1ce5b36393878dff35c5a3fe37dc8aa6ca474.tar.xz
pipeworks-aba1ce5b36393878dff35c5a3fe37dc8aa6ca474.zip
allow reordering of itemstacks in sorting tube
-rw-r--r--sorting_tubes.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/sorting_tubes.lua b/sorting_tubes.lua
index 6d432ae..efe4b4f 100644
--- a/sorting_tubes.lua
+++ b/sorting_tubes.lua
@@ -119,8 +119,13 @@ if pipeworks.enable_mese_tube then
if not pipeworks.may_configure(pos, player) then return 0 end
update_formspec(pos) -- For old tubes
local inv = minetest.get_meta(pos):get_inventory()
- inv:set_stack(from_list, from_index, ItemStack(""))
- return 0
+
+ if from_list:match("line%d") and to_list:match("line%d") then
+ return count
+ else
+ inv:set_stack(from_list, from_index, ItemStack(""))
+ return 0
+ end
end,
},
})