summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVanessaE <vanessaezekowitz@gmail.com>2013-04-13 09:30:35 -0700
committerVanessaE <vanessaezekowitz@gmail.com>2013-04-13 09:30:35 -0700
commit1713f30d2121418ff5d4cc454043a227c3df0cc3 (patch)
tree59d837513d7e2a203dcc4e4ff7a0600b855f56b3
parent3788437c91599da67f54530e46d6f7d0b91f342c (diff)
parent9001f0c2939212719b15a02cdad3d93cac6e909c (diff)
downloadpipeworks-1713f30d2121418ff5d4cc454043a227c3df0cc3.tar
pipeworks-1713f30d2121418ff5d4cc454043a227c3df0cc3.tar.gz
pipeworks-1713f30d2121418ff5d4cc454043a227c3df0cc3.tar.bz2
pipeworks-1713f30d2121418ff5d4cc454043a227c3df0cc3.tar.xz
pipeworks-1713f30d2121418ff5d4cc454043a227c3df0cc3.zip
Merge pull request #29 from Novatux/master
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)