summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2013-12-15 06:10:03 -0500
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2013-12-15 06:10:03 -0500
commit030ae3283d83e37ce52d5af78a7e98949f56925c (patch)
treeca7510e753c1eaa7451b8b840e96089b2a576fd3
parent072f78a360a3859890b36b2c3c0b636d53f9508e (diff)
downloadpipeworks-030ae3283d83e37ce52d5af78a7e98949f56925c.tar
pipeworks-030ae3283d83e37ce52d5af78a7e98949f56925c.tar.gz
pipeworks-030ae3283d83e37ce52d5af78a7e98949f56925c.tar.bz2
pipeworks-030ae3283d83e37ce52d5af78a7e98949f56925c.tar.xz
pipeworks-030ae3283d83e37ce52d5af78a7e98949f56925c.zip
local-ize a few more variables
-rw-r--r--item_transport.lua12
1 files changed, 7 insertions, 5 deletions
diff --git a/item_transport.lua b/item_transport.lua
index d20dfc3..ab961d9 100644
--- a/item_transport.lua
+++ b/item_transport.lua
@@ -73,7 +73,7 @@ local function grabAndFire(frominv,frominvname,frompos,fromnode,sname,tube,idef,
idef.on_metadata_inventory_take(frompos, "main", spos, item, fakePlayer)
end
end
- item1=tube_item(frompos,item)
+ local item1=tube_item(frompos,item)
item1:get_luaentity().start_pos = frompos
item1:setvelocity(dir)
item1:setacceleration({x=0, y=0, z=0})
@@ -257,12 +257,13 @@ local function go_next(pos,velocity,stack)
else
can_go=notvel(adjlist,vel)
end
+ local meta = nil
for _,vect in ipairs(can_go) do
- npos=addVect(pos,vect)
- node=minetest.get_node(npos)
- tube_receiver=minetest.get_item_group(node.name,"tubedevice_receiver")
+ local npos=addVect(pos,vect)
+ local node=minetest.get_node(npos)
+ local tube_receiver=minetest.get_item_group(node.name,"tubedevice_receiver")
meta=minetest.get_meta(npos)
- tubelike=meta:get_int("tubelike")
+ local tubelike=meta:get_int("tubelike")
if tube_receiver==1 then
if minetest.registered_nodes[node.name].tube and
minetest.registered_nodes[node.name].tube.can_insert and
@@ -462,6 +463,7 @@ minetest.register_entity("pipeworks:tubed_item", {
node = minetest.get_node(self.start_pos)
if moved and minetest.get_item_group(node.name,"tubedevice_receiver")==1 then
+ local leftover = nil
if minetest.registered_nodes[node.name].tube and minetest.registered_nodes[node.name].tube.insert_object then
leftover = minetest.registered_nodes[node.name].tube.insert_object(self.start_pos,node,stack,vel)
else