summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeija <norrepli@gmail.com>2012-06-21 17:27:29 +0200
committerJeija <norrepli@gmail.com>2012-06-21 17:27:29 +0200
commit11ae41f1192d798d713a34c437cd667711241ae3 (patch)
tree23a85cbea19235c84c3e78569207fe8954c61498
parent7d944d5a338fc74935d55639db0ce019bbd93cd3 (diff)
downloadmesecons-11ae41f1192d798d713a34c437cd667711241ae3.tar
mesecons-11ae41f1192d798d713a34c437cd667711241ae3.tar.gz
mesecons-11ae41f1192d798d713a34c437cd667711241ae3.tar.bz2
mesecons-11ae41f1192d798d713a34c437cd667711241ae3.tar.xz
mesecons-11ae41f1192d798d713a34c437cd667711241ae3.zip
Tune Buttons to work together with Door
-rw-r--r--mesecons_button/init.lua10
1 files changed, 6 insertions, 4 deletions
diff --git a/mesecons_button/init.lua b/mesecons_button/init.lua
index 7d7ec93..0096df3 100644
--- a/mesecons_button/init.lua
+++ b/mesecons_button/init.lua
@@ -52,20 +52,20 @@ end)
mesecon.button_turnoff = function (params)
if minetest.env:get_node(params.pos).name=="mesecons_button:button_on" then
minetest.env:add_node(params.pos, {name="mesecons_button:button_off", param2=params.param2})
- local rules=mesecon.button_get_rules(param2)
+ local rules=mesecon.button_get_rules(params.param2)
mesecon:receptor_off(params.pos, rules)
end
end
mesecon.button_get_rules = function(param2)
local rules=mesecon:get_rules("button")
- if param2 == 5 then
+ if param2 == 2 then
rules=mesecon:rotate_rules_left(rules)
end
if param2 == 3 then
rules=mesecon:rotate_rules_right(mesecon:rotate_rules_right(rules))
end
- if param2 == 4 then
+ if param2 == 0 then
rules=mesecon:rotate_rules_right(rules)
end
return rules
@@ -92,7 +92,9 @@ mesecon:add_rules("button", {
{x=0, y=0, z=-1},
{x=0, y=-1, z=-1},
{x=0, y=-1, z=0},
-{x=2, y=0, z=0}})
+{x=2, y=0, z=0},
+{x=1, y=-1, z=1},
+{x=1, y=-1, z=-1}})
mesecon:add_receptor_node_off("mesecons_button:button_off", nil, mesecon.button_get_rules)
mesecon:add_receptor_node("mesecons_button:button_on", nil, mesecon.button_get_rules)