Add option to disable cyclic behaviour
authorNovatux <nathanael.courant@laposte.net>
Fri, 28 Jun 2013 13:16:28 +0000 (15:16 +0200)
committerNovatux <nathanael.courant@laposte.net>
Fri, 28 Jun 2013 13:16:28 +0000 (15:16 +0200)
init.lua
item_transport.lua

index d9434242efd18efd2df496929d54a72df9f9c4dd..7136d4be6f3e202dded71c1d2dae7a8d516109b3 100644 (file)
--- a/init.lua
+++ b/init.lua
@@ -14,6 +14,7 @@
 
 minetest.register_alias("pipeworks:pipe", "pipeworks:pipe_110000_empty")
 local DEBUG = false
+local CYCLIC = true
 
 pipeworks_liquid_texture = "default_water.png"
 
index 12a177c2cca460d73a4c8c4d1d6ca5aa859c01ed..b733d32154982928bdc07e14cdb30abea14da87f 100644 (file)
@@ -465,7 +465,9 @@ function go_next(pos,velocity,stack)
                                        break
                                end
                        until false
-                       meta:set_int("tubedir",n)
+                       if CYCLIC then
+                               meta:set_int("tubedir",n)
+                       end
                        velocity.x=tubes[n].vect.x*vel.speed
                        velocity.y=tubes[n].vect.y*vel.speed
                        velocity.z=tubes[n].vect.z*vel.speed
@@ -484,6 +486,9 @@ function go_next(pos,velocity,stack)
                                break
                        end
                until false
+               if CYCLIC then
+                       meta:set_int("tubedir",n)
+               end
                velocity.x=chests[n].vect.x*speed
                velocity.y=chests[n].vect.y*speed
                velocity.z=chests[n].vect.z*speed