From 42f739da06d6082fc7cc414435072321ae20f6a5 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Mon, 9 Jan 2012 14:30:11 +0100 Subject: A Button shouldn't be placed on Floor/Ceiling --- jeija/button.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'jeija') diff --git a/jeija/button.lua b/jeija/button.lua index bc3ec17..8288cea 100644 --- a/jeija/button.lua +++ b/jeija/button.lua @@ -32,6 +32,12 @@ minetest.register_on_dignode( end end ) +minetest.register_on_placenode(function(pos, node) + if node.param2 == 4 or node.param2 == 8 then + minetest.env:remove_node(pos) + minetest.env:add_item(pos, 'node jeija:wall_button_off 1') + end +end) minetest.register_on_punchnode(function(pos, node, puncher) if node.name == "jeija:wall_button_off" then minetest.env:add_node(pos, {name="jeija:wall_button_on",param2=node.param2}) -- cgit v1.2.3