fix crash where I forgot to actually index the metadata elements I added to
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>
Tue, 21 Aug 2012 09:20:47 +0000 (05:20 -0400)
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>
Tue, 21 Aug 2012 09:20:47 +0000 (05:20 -0400)
the valves' on-punch-node functions

devices.lua

index 71e8eac523799e9403babda53f89d2004eaa5943..b490d015f2ad928845905c4c30146d1f37a3ffa8 100644 (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)