summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNovatux <nathanael.courant@laposte.net>2013-04-13 11:47:50 +0200
committerNovatux <nathanael.courant@laposte.net>2013-04-13 11:47:50 +0200
commit9001f0c2939212719b15a02cdad3d93cac6e909c (patch)
tree13d6b0cde1720b5dda067f0809432a35563b1f29
parent33e3d76cec976fbcdca61a43317e1872da48160d (diff)
downloadpipeworks-9001f0c2939212719b15a02cdad3d93cac6e909c.tar
pipeworks-9001f0c2939212719b15a02cdad3d93cac6e909c.tar.gz
pipeworks-9001f0c2939212719b15a02cdad3d93cac6e909c.tar.bz2
pipeworks-9001f0c2939212719b15a02cdad3d93cac6e909c.tar.xz
pipeworks-9001f0c2939212719b15a02cdad3d93cac6e909c.zip
Fix repartition of teleport tubes not being random.
-rw-r--r--teleport_tube.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/teleport_tube.lua b/teleport_tube.lua
index ac1a613..c162952 100644
--- a/teleport_tube.lua
+++ b/teleport_tube.lua
@@ -76,9 +76,10 @@ register_tube("pipeworks:teleport_tube","Teleporter pneumatic tube segment",tele
channel=meta:get_string("channel")
goto=get_tubes_in_file(pos,channel)
if goto[1]==nil then return {} end
- pos.x=goto[1].x
- pos.y=goto[1].y
- pos.z=goto[1].z
+ d=math.random(1,#goto)
+ pos.x=goto[d].x
+ pos.y=goto[d].y
+ pos.z=goto[d].z
return meseadjlist
end},
on_construct = function(pos)