Fixed error with downspout

This commit is contained in:
DonBatman 2015-12-01 05:39:11 -08:00
parent 0b0194cd9c
commit 321b080701

View File

@ -197,7 +197,7 @@ minetest.register_node("mysheetmetal:downspout_bottom", {
}
},
on_punch = function(pos, node, puncher, pointed_thing)
minetest.set_node({x = pos.x, y = pos.y, z = pos.z},{name = "mysheetmetal:downspout_bottomw", param2=minetest.dir_to_facedir(puncher:get_look_dir())})
minetest.set_node({x = pos.x, y = pos.y, z = pos.z},{name = "mysheetmetal:downspout_bottomw", param2=node.param2})
end
})
@ -248,17 +248,9 @@ minetest.register_node("mysheetmetal:downspout_bottomw", {
{-0.125, -0.5, -0.125, 0.125, -0.3125, 0.5},
}
},
after_place_node = function(pos, placer)
local meta = minetest.get_meta(pos);
meta:set_string("owner", (placer:get_player_name() or ""));
on_punch = function(pos, node, puncher, pointed_thing)
local owner = minetest.get_meta(pos).owner
if puncher == owner then
minetest.set_node({x = pos.x, y = pos.y, z = pos.z},{name = "mysheetmetal:downspout_bottom", param2=minetest.dir_to_facedir(puncher:get_look_dir())})
else
return
end
minetest.set_node(pos,{name = "mysheetmetal:downspout_bottom", param2=node.param2})
end
})