diff options
author | Vanessa Ezekowitz <vanessaezekowitz@gmail.com> | 2017-03-29 17:58:19 -0400 |
---|---|---|
committer | Vanessa Ezekowitz <vanessaezekowitz@gmail.com> | 2017-03-29 17:58:19 -0400 |
commit | 829509cc01729476595609ed63f4ccb15d651690 (patch) | |
tree | eabf41edc9d9eee0b20d848d3e1a18274dd6380f | |
parent | 46bad03090da1a5f78782f6c8b9afc4cbb24c2c9 (diff) | |
download | dreambuilder_modpack-829509cc01729476595609ed63f4ccb15d651690.tar dreambuilder_modpack-829509cc01729476595609ed63f4ccb15d651690.tar.gz dreambuilder_modpack-829509cc01729476595609ed63f4ccb15d651690.tar.bz2 dreambuilder_modpack-829509cc01729476595609ed63f4ccb15d651690.tar.xz dreambuilder_modpack-829509cc01729476595609ed63f4ccb15d651690.zip |
update pipeworks again
-rw-r--r-- | pipeworks/item_transport.lua | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/pipeworks/item_transport.lua b/pipeworks/item_transport.lua index c89eaf5..e906387 100644 --- a/pipeworks/item_transport.lua +++ b/pipeworks/item_transport.lua @@ -251,8 +251,8 @@ luaentity.register_entity("pipeworks:tubed_item", { local rev_node = minetest.get_node(vector.round(vector.add(self.start_pos,rev_dir))) local tube_present = minetest.get_item_group(rev_node.name,"tubedevice") == 1 if not found_next then + local drop_pos = minetest.find_node_near(vector.add(self.start_pos, velocity), 1, "air") if pipeworks.drop_on_routing_fail or not tube_present then - drop_pos = minetest.find_node_near(vector.add(self.start_pos, velocity), 1, "air") if drop_pos then -- Using add_item instead of item_drop since this makes pipeworks backward -- compatible with Minetest 0.4.13. @@ -262,9 +262,17 @@ luaentity.register_entity("pipeworks:tubed_item", { return end else - print("[Pipeworks] Warning - tubed item had to reverse direction at "..minetest.pos_to_string(self.start_pos)) - velocity = vector.multiply(velocity, -1) - self:setvelocity(velocity) + if minetest.get_item_group(rev_node.name,"tube") == 1 then + print("[Pipeworks] Warning - tubed item had to reverse direction at "..minetest.pos_to_string(self.start_pos)) + velocity = vector.multiply(velocity, -1) + self:setvelocity(velocity) + else + if drop_pos then + minetest.add_item(drop_pos, stack) + self:remove() + return + end + end end end |