diff options
author | Vanessa Ezekowitz <vanessaezekowitz@gmail.com> | 2013-12-21 03:45:45 -0500 |
---|---|---|
committer | Vanessa Ezekowitz <vanessaezekowitz@gmail.com> | 2013-12-21 03:45:45 -0500 |
commit | e5344edf9892abdae2e2e43a4d87bcfe61f9e044 (patch) | |
tree | 6d344afc963ae5af340f867cbb09148c31af4f03 | |
parent | e1435b1c2fcda93a0a0b9a5be383cfd7892060b4 (diff) | |
download | pipeworks-e5344edf9892abdae2e2e43a4d87bcfe61f9e044.tar pipeworks-e5344edf9892abdae2e2e43a4d87bcfe61f9e044.tar.gz pipeworks-e5344edf9892abdae2e2e43a4d87bcfe61f9e044.tar.bz2 pipeworks-e5344edf9892abdae2e2e43a4d87bcfe61f9e044.tar.xz pipeworks-e5344edf9892abdae2e2e43a4d87bcfe61f9e044.zip |
local-ize a couple of variables, code style fixes
-rw-r--r-- | teleport_tube.lua | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/teleport_tube.lua b/teleport_tube.lua index a67daed..845c1d9 100644 --- a/teleport_tube.lua +++ b/teleport_tube.lua @@ -68,21 +68,23 @@ local teleport_short_texture="pipeworks_teleport_tube_short.png" local teleport_inv_texture="pipeworks_teleport_tube_inv.png" pipeworks.register_tube("pipeworks:teleport_tube","Teleporter pneumatic tube segment",teleport_plain_textures, - teleport_noctr_textures,teleport_end_textures,teleport_short_texture,teleport_inv_texture, - {tube={can_go=function(pos,node,velocity,stack) - velocity.x=0 - velocity.y=0 - velocity.z=0 - local meta = minetest.get_meta(pos) - channel=meta:get_string("channel") - local target=get_tubes_in_file(pos,channel) - if target[1]==nil then return {} end - d=math.random(1,#target) - pos.x=target[d].x - pos.y=target[d].y - pos.z=target[d].z - return pipeworks.meseadjlist - end}, + teleport_noctr_textures,teleport_end_textures,teleport_short_texture,teleport_inv_texture, { + tube = { + can_go = function(pos,node,velocity,stack) + velocity.x = 0 + velocity.y = 0 + velocity.z = 0 + local meta = minetest.get_meta(pos) + local channel = meta:get_string("channel") + local target = get_tubes_in_file(pos,channel) + if target[1] == nil then return {} end + local d = math.random(1,#target) + pos.x = target[d].x + pos.y = target[d].y + pos.z = target[d].z + return pipeworks.meseadjlist + end + }, on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("channel","") |