summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsfan5 <sfan5@live.de>2012-01-09 14:30:11 +0100
committersfan5 <sfan5@live.de>2012-01-09 14:30:11 +0100
commit42f739da06d6082fc7cc414435072321ae20f6a5 (patch)
treee31308dfe64ea5ebac41ff0fff7fed20769051b7
parent410c0d6946e80ac7e8a7a8c161be670c5193e16e (diff)
downloadmesecons-42f739da06d6082fc7cc414435072321ae20f6a5.tar
mesecons-42f739da06d6082fc7cc414435072321ae20f6a5.tar.gz
mesecons-42f739da06d6082fc7cc414435072321ae20f6a5.tar.bz2
mesecons-42f739da06d6082fc7cc414435072321ae20f6a5.tar.xz
mesecons-42f739da06d6082fc7cc414435072321ae20f6a5.zip
A Button shouldn't be placed on Floor/Ceiling
-rw-r--r--jeija/button.lua6
1 files changed, 6 insertions, 0 deletions
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})