1
0
mirror of https://github.com/mt-mods/pipeworks.git synced 2024-12-25 18:30:23 +01:00

fix crash where I forgot to actually index the metadata elements I added to

the valves' on-punch-node functions
This commit is contained in:
Vanessa Ezekowitz 2012-08-21 05:20:47 -04:00
parent 4b0b137f94
commit e103143ea7

View File

@ -319,6 +319,7 @@ for a in ipairs(axes) do
minetest.register_on_punchnode(function (pos, node)
if node.name=="pipeworks:valve_on_"..axes[a] then
minetest.env:add_node(pos, { name = "pipeworks:valve_off_"..axes[a] })
local meta = minetest.env:get_meta(pos)
meta:set_int("pipelike",0)
end
end)
@ -326,6 +327,7 @@ for a in ipairs(axes) do
minetest.register_on_punchnode(function (pos, node)
if node.name=="pipeworks:valve_off_"..axes[a] then
minetest.env:add_node(pos, { name = "pipeworks:valve_on_"..axes[a] })
local meta = minetest.env:get_meta(pos)
meta:set_int("pipelike",1)
end
end)